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



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


chakradhar
color changing
1 Answer(s)      4 years and 9 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
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? 
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
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
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
div background color in html
div background color in html   How to change the background color of DIV in HTML
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
Advertisements
 

 

 

DMCA.com