Results 1 to 3 of 3

Thread: Java Color Choosers

  1. #1
    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.....

  2. #2
    Join Date
    May 2008
    Posts
    2,012

    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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

Similar Threads

  1. Replies: 3
    Last Post: 18-03-2012, 07:33 PM
  2. Set ToolTip Text background color in java
    By Adrina_g in forum Software Development
    Replies: 4
    Last Post: 24-02-2010, 11:05 PM
  3. Changing the Color Theme in Java
    By NIcaBoy in forum Software Development
    Replies: 4
    Last Post: 14-02-2010, 03:23 AM
  4. JAVA Help - Background change by color matching
    By Daren in forum Software Development
    Replies: 4
    Last Post: 12-05-2009, 08:41 AM
  5. Change Color Schemes in Java
    By NetWorm in forum Software Development
    Replies: 1
    Last Post: 10-03-2009, 01:37 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,032,212.58429 seconds with 16 queries