Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


chakradhar
color changing
1 Answer(s)      4 years and 3 months ago
Posted in : Java Beginners


sir how to change the color of the selected tab in java swing

Advertisement
View Answers

April 10, 2010 at 4:30 PM


Hi Friend,

Try the following code:

import javax.swing.*;
import java.awt.*;
import javax.swing.event.*;
import java.awt.event.*;

public class CreateTabbedPane{
public static void main(String[] args){
JFrame frame = new JFrame("Tabbed Pane Frame");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
UIManager.put("TabbedPane.selected", Color.blue);
JTabbedPane tab = new JTabbedPane();
frame.add(tab, BorderLayout.CENTER);
tab.add("Tab 1", new JLabel("This is Tabbed Pane 1"));
tab.add("Tab 2", new JLabel("This is Tabbed Pane 2"));
tab.add("Tab 3", new JLabel("This is Tabbed Pane 3"));
tab.add("Tab 4", new JLabel("This is Tabbed Pane 4"));
frame.setSize(400,100);
frame.setVisible(true);
}
}

Thanks


Related Tutorials/Questions & Answers:
changing uiview background color
changing uiview background color  changing UIView background color in ios   self.view.backgroundColor = [UIColor colorWithRed:244.0f/255.0f green:230.0f/255.0f blue:183.0f/255.0f alpha:1.0f
changing selection color of <button>
changing selection color of   dear all, i have loaded image in border less button tag when button is selected with tab key i get brown color rectangle around image. how do i change color of that rectangle from brown to white
Advertisements
color changing - Java Beginners
color changing  sir how to change the color of the selected tab in java swing  Hi Friend, Try the following code: import javax.swing.*; import java.awt.*; import javax.swing.event.*; import java.awt.event.
Changing background color using JavaScript
Changing background color using JavaScript  Hi Sir Is there any way to change the background color using JavaScript ? Please mention code with your answer.   Hello Friend Pass the element & color in the given
Changing the message box to a specific color
Changing the message box to a specific color  How do you change the message box color to a specific color? I can get the color to change with each input but i cant give it a specific color. Example I'm trying to change
How to design a changing color of the chameleon, changing color of the chameleon, color of the chameleon
How to design a changing color of the chameleon       Have you seen the chameleon to changing the color, you can see now by this example. Let's see how the chameleon
changing Background Color
changing Background Color   ... change background color of a pdf file. You can change the background color of any chunk with the help of setBackground(Color color). 
How to Changing Toolbar Color using iPhone Application ?
How to Changing Toolbar Color using iPhone Application ?  Hi, i have developing a small application to changing the toolbar color in iphone. But i have facing the problem that color is not changing. Can somebody suggest me
changing Chunk Color
changing Chunk Color     ... is a method of FontFactory. We are changing the color of the chunk... change the color of chunk color .This example tell you how you can change
Photoshop eye color brown to blue
Photoshop eye color brown to blue       How to change the eye color from brown to blue If you want to change the eye color but you are not able to do that then this tutorial
changing of data...
servlet.database is not changing in 10 second  hi.... i have created a servlet page using a response.setheader(); method.in the parameter i have... this servlet.database is not changing in 10 second...what should i do..?? reply fast
changing of data...
data changing in 10 second  hi.... i have created a servlet page using a response.setheader(); method.in the parameter i have given 10 second.but... is not changing in 10 second...what should i do..?? reply fast
changing of data...
changing of data...  hi.... i have created a servlet page using a response.setheader(); method.in the parameter i have given 10 second.but once... is not changing in 10 second...what should i do..?? reply fast
Color
to create new colors, and predefines a few color constants (see below.... White is (255, 255, 255) and black is (0,0,0). Color Constants Java originally defined a few color constant names in lowercase, which violated
Changing root Password
Changing root Password  how do i change the root password in mysql
Changing pictures - Java Beginners
Changing pictures  I found some html code that allows pictures to be changed on a web page. I copied the code and saved it as an html file. when I... Explorer that have pictures changing on them and they do not get blocked? 
Changing MySQL Port Number
Changing MySQL Port Number  How to change the MySQL port no in windows.   Hi, Open the my.ini file present in the MySQL server installation directory. Change the port number to desired port number. By default port
Changing 2D graph using slider.
Changing 2D graph using slider.  Code for changing a 2d graph with help of slider
changing the file content
changing the file content  I have requirement like this, a file contain maximum 1000 lines. I want to cahnage the 501 line content. I know this logic , reading the file content and changeing the 501 line content and crating one
UIButton text color
UIButton text color  Hi, I have to change the text color of UIButton to black. Give me best code for changing UIButton text color to black. Thanks
color change
color change  how to change the color in circle using scrollbar
color cycle
color cycle  how do you implement a program for color cycle that has a button such that when i press the button it brings a sequence for example green-red-grey-green e.t.c and should use the getter methods and set methods
Changing JLabel with a jcombobox - Java Beginners
Changing JLabel with a jcombobox  Hi, I have a JLabel which should change when i select an item from JCombobox.I have some calculations after i get a value from the combo,the result of which i have to display using a JLabel I
Changing Executable Jar File Icon
Changing Executable Jar File Icon  I have created an executable jar file for my java program and the icon that appears is the java icon. I will like to know if there is a way to change this to any icon of my choice.   
changing primary key of parent table
changing primary key of parent table  I want to change one primary key from a table where primary key is auto created? How can I do that? I have tried UPDATE person SET personid=3494 WHERE personid=8483; and i get the following
changing final Boolean value in SwingUtilities.invokeLater()
changing final Boolean value in SwingUtilities.invokeLater()  Hi, I have a problem with setting final Boolean value in second time. But it is necessary to me. Have You any Idea of this Scenario? Here is my code: public
Get the color values as a matrix of color image
Get the color values as a matrix of color image  I am new to java and image processing, i want to get the color values as a matrix from the color image for giving input to the compression algorithm by using java. plz provide
Highlight text by changing color on every click(Toggle effect)
Highlight text by changing color on every click(Toggle effect..., it gets highlighted by changing it's color. If you click already highlighted list element ,it also change it's color. The color sequence or toggle
how to reverse a string without changing its place
how to reverse a string without changing its place  how to reverse a string without changing its place   Hi Friend, Another way of reversing string: import java.util.*; public class ReverseString{ public static
Line Animation in Java
x  is changing. The rang of the value is -500 to 600. The color of the line is changing by setColor() method. To remove old color and set new one or ...; In this example we are creating an animated line. The color
div background color in html
div background color in html   How to change the background color of DIV in HTML
Changing from Struts 1.2 to Struts 2.0 in Application
Changing from Struts 1.2 to Struts 2.0 in Application  Hi All, We have a financial application which is running successfully on struts 1.2 and java 1.4. Since this are old versions and obsoleted from market. We want to use
UITextfield Background Color
is ..it's showing a background color. Though my text field color is white. Can you please suggest.. , how can i remove the background color of text field. Thanks!   iPhone UITextField Background Color Set the text field background color
select the foreground color for a label
select the foreground color for a label  (Using JScrollBar) Write a program that uses scroll bars to select the foreground color for a label, Three... of the color. Use a title border on the panel that holds the scroll bars
color coding in java
color coding in java  hii..can anyone please help with auto coloring code in java swings..??a particular text field should have a particular color for a particular event..plzz help
Color Wheel - Java Beginners
Color Wheel  Hai to all... Just want to need some code about the GUI, were using the java.lang and java.awt.. Were making a color wheel program.. Thank'z to all who help me... GOD bless
Get image color
Get image color  How to get image color in iPhone SDK application
uiscrollview background color
uiscrollview background color  Is it possible to set the uiscrollview background color in iPhone application
HTML document's background color
HTML document's background color  How to set a HTML document's background color
Changing random results to ASC or DSC - SQL
Changing random results to ASC or DSC  I have a script that randomizes results. I have tried to convert code to display a constant result, ascending or descending while in session. I can't seem to convert script due to session
Changing loacation for file object - JSP-Servlet
Changing loacation for file object  Hai, For uploading a file i used the FileOutputStream() method. And uploading works perfectly... Foundation\Tomcat 6.0\webapps\mca2006sfssjc.co.in\stud\images by changing
jframe background color not showing
jframe background color not showing  jframe background color is not showing. please suggest.   Just add the background color to JPanel and then add it to JFrame. For example .. JFrame myFrame = new JFrame(); JPanel
UITableView Background Color
]; The above line will change the default background color into gray color. You can also set the gradient to it. In this example we are simply changing the color...UITableView Background Color To change the background color of UITableView
How to design a color in the bucket, design a color in the bucket, color in the bucket
How to design a color in the bucket       Fill color in the blank bucket by taking help.... Color: Choose "f30011" color and Ellipse tool (U key) to draw
uitableviewcell selected color
uitableviewcell selected color  HI, How to add uitableviewcell selected color? Thanks   Hi, Here is the code: UIView *viewSelected = [[[UIView alloc] init] autorelease]; viewSelected.backgroundColor = [UIColor
change player dress color
change player dress color  Hai friends, Can we change player dress color using J2ME. Please provide me an code for this. I can able to attain three colors only. Send the code to mail id. vijaikiranit@gmail.com
HTML - table background color.
HTML - table background color. Description : Here, you will see how to specifies the table back ground color in html page. The <table > is a html... the background color of table.  Code : <!DOCTYPE html PUBLIC "
random color fill
random color fill   Hi I am trying to create a randomly color filled oval but the outcome is a black filled oval this is the code: package...); g.fillOval(x, y, 200, 200); Color randomColor = new Color(r, g1, b
Tetris Color - Swing AWT
Tetris Color  I have created Tetris game in Swing but I want to delete row when 6 blocks of same colors so how can i retrieve color from different classes an t how to check condition
 

 

 

DMCA.com