Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 11-05-2009
Member
 
Join Date: Feb 2009
Posts: 78
Java Color Choosers

hello friends,

I want to know what do you mean by the component called color choosers in Java ? and how do I use this component in my program ? Can anyone provide the information regarding this.....
Reply With Quote
  #2  
Old 11-05-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Java Color Choosers

A color chooser is a component that you can place anywhere within your program GUI. The color chooser consists of everything within the box labeled Choose Text Color.
This is how a standard color chooser looks like in Java.


It contains two parts - (i) a tabbed pane and (ii) a preview panel.
(i) In the tabbed pane, the three tabs select chooser panels.
(ii) The preview panel below the tabbed pane displays the currently selected color.

Use the JColorChooser class to provide users with a palette of colors to choose from. The JColorChooser API also makes it easy to bring up a dialog (modal or not) that contains a color chooser.
Reply With Quote
  #3  
Old 11-05-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Java Color Choosers

An example code that creates a JColorChooser instance and adds it to a container:

public class ColorChooserDemo extends JPanel ... {
public ColorChooserDemo()
{
super(new BorderLayout());
banner = new JLabel("Welcome to the Tutorial Zone!",
JLabel.CENTER);
banner.setForeground(Color.yellow);
. . .
tcc = new JColorChooser(banner.getForeground());
. . .
add(tcc, BorderLayout.PAGE_END);
}


For the detailed code - click here
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Java Color Choosers"
Thread Thread Starter Forum Replies Last Post
Is there any option to change the color of friend/foe to help color blinds play Birds of Steel? I M Perfect Video Games 3 18-03-2012 07:33 PM
Set ToolTip Text background color in java Adrina_g Software Development 4 24-02-2010 11:05 PM
Changing the Color Theme in Java NIcaBoy Software Development 4 14-02-2010 03:23 AM
JAVA Help - Background change by color matching Daren Software Development 4 12-05-2009 08:41 AM
Change Color Schemes in Java NetWorm Software Development 1 10-03-2009 01:37 PM


All times are GMT +5.5. The time now is 03:11 PM.