borland Packages  Class Hierarchy  jbcl.control Package  Index 

ColorChooserDialog class

java.lang.Object
   +----java.awt.Component
           +----java.awt.Container
                   +----java.awt.Window
                           +----java.awt.Dialog
                                   +----borland.jbcl.control.ButtonDialog
                                           +----borland.jbcl.control.ColorChooserDialog

About the ColorChooserDialog class

Variables  Constructors  Properties  Methods  Event Listeners

Implements ActionListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener

The ColorChooserDialog component displays a color dialog box that enables the user to select a color.

The dialog box contains three text boxes, one each for Red, Green, and Blue numerical values. The user can specify the values by entering the values directly or using the slider controls under the text boxes. As the user modifies the numerical values, the resulting color is displayed in a rounded rectangle.

The dialog box also contains two radio buttons so the user can specify whether the values are RGB or HGB. The dialog box also contains a drop-down list from which the user can select a color.

To display the dialog box at runtime, call the show() method or set the visible property to true. When the user selects a color, the selection is stored in the value property.

The dialog box has two buttons, OK and Cancel. Which button the user chooses to put away the dialog box is stored as the value of the result property. The title property contains the text that appears on the title bar of the dialog box's frame.

Usually you should use ColorChooser instead of ColorChooserDialog. ColorChooser calls the constructor of ColorChooserDialog, but you can work with ColorChooser within the UI Designer and even display it at design time. You can set the properties of ColorChooserDialog only at runtime.


ColorChooserDialog variables

Variables implemented in this class

Variables implemented in borland.jbcl.control.ButtonDialog

Variables implemented in java.awt.Component

ColorChooserDialog constructors

ColorChooserDialog properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in borland.jbcl.control.ButtonDialog

Properties implemented in java.awt.Component

Properties implemented in java.awt.Container

Properties implemented in java.awt.Dialog

Properties implemented in java.awt.Window

Properties implemented in java.lang.Object

ColorChooserDialog methods

Methods implemented in borland.jbcl.control.ButtonDialog

Methods implemented in java.awt.Component

Methods implemented in java.awt.Container

Methods implemented in java.awt.Dialog

Methods implemented in java.awt.Window

Methods implemented in java.lang.Object

ColorChooserDialog event listeners


ColorChooserDialog variables

panel

  protected ColorChooserPanel panel

The ColorChooserPanel object to show in this dialog box. The color chooser panel enables the user to specify colors within the dialog box.


ColorChooserDialog constructors

ColorChooserDialog(java.awt.Frame)

  public ColorChooserDialog(java.awt.Frame frame)
Constructs a color chooser dialog box with the specified parent frame.

Parameters:

frame
The parent frame for the dialog box.

See also: java.awt.Frame

ColorChooserDialog(java.awt.Frame, java.lang.String)

  public ColorChooserDialog(java.awt.Frame frame, java.lang.String title)
Constructs a color chooser dialog box with the specified parent frame.

Parameters:

frame
The parent frame for the dialog box.
title
The text that appears in the title bar of the dialog box.

See also: java.awt.Frame

ColorChooserDialog(java.awt.Frame, java.lang.String, java.awt.Color)

  public ColorChooserDialog(java.awt.Frame frame, java.lang.String title, java.awt.Color value)
Constructs a color chooser dialog box.

Parameters:

frame
The parent frame for the dialog box.
title
The text that appears in the title bar of the dialog box.
value
The initially specified color that is selected when the dialog box appears.

See also: java.awt.Frame, java.lang.String, java.awt.Color


ColorChooserDialog properties

value

 public Color getValue()
 public void setValue(java.awt.Color value)
Determines the color selected in the dialog box. When the user selects a color and closes the dialog box, the value property is set with the new color value.

See also: java.awt.Color


ColorChooserDialog event listeners

This class is a source for the following event sets. For information on the standard AWT event sets, see Standard Java events.

action

 public synchronized void addActionListener(java.awt.event.ActionListener l)
 public synchronized void removeActionListener(java.awt.event.ActionListener l)

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener )
 public synchronized void removeComponentListener(java.awt.event.ComponentListener )

container

 public synchronized void addContainerListener(java.awt.event.ContainerListener )
 public void removeContainerListener(java.awt.event.ContainerListener )

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener )
 public synchronized void removeFocusListener(java.awt.event.FocusListener )

key

 public synchronized void addKeyListener(java.awt.event.KeyListener )
 public synchronized void removeKeyListener(java.awt.event.KeyListener )

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener )
 public synchronized void removeMouseListener(java.awt.event.MouseListener )

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener )
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )

window

 public synchronized void addWindowListener(java.awt.event.WindowListener )
 public synchronized void removeWindowListener(java.awt.event.WindowListener )