borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.control 

ColorChooser component

java.lang.Object
   +----borland.jbcl.control.ColorChooser

About the ColorChooser component

Variables  Constructors  Properties  Methods  Event Listeners

Implements WindowListener, EventListener

A wrapper for ColorChooserDialog, which allows graphical selection of color values. This creates a data-aware, fully-enabled version of ColorChooserDialog.

After adding a ColorChooser to your program using the UI Designer, you usually need to set the frame to this, in the Component Inspector. Otherwise, the ColorChooser will not appear when you try to open it.

Relationship of the JBCL color chooser classes:


ColorChooser variables

Variables implemented in this class

ColorChooser constructors

ColorChooser properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

ColorChooser methods

Methods implemented in this class

Methods implemented in java.lang.Object

ColorChooser event listeners


ColorChooser variables

CANCEL

  public static final int CANCEL = ButtonDialog.CANCEL

OK

  public static final int OK = ButtonDialog.OK

aList

  protected Array aList

dialog

  protected ColorChooserDialog dialog

focus

  protected Component focus

frame

  protected Frame frame

result

  protected int result

title

  protected String title

value

  protected Color value

ColorChooser constructors

ColorChooser()

  public ColorChooser()
Creates a new color chooser dialog box without a frame or any title bar text. No initial color value is selected.

ColorChooser(java.awt.Frame)

  public ColorChooser(java.awt.Frame frame)
Creates a new color chooser dialog, specifying the frame as the parent, with no title bar text. No initial color value is selected.

Parameters:

frame
The parent frame of the color chooser dialog box.

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

  public ColorChooser(java.awt.Frame frame, java.lang.String title)
Creates a new color chooser dialog using the specified frame and title bar text. No initial color value is selected.

Parameters:

frame
The parent frame of the color chooser dialog box.
title
The title text of the color chooser dialog box, usually shown in the title bar.

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

  public ColorChooser(java.awt.Frame frame, java.lang.String title, java.awt.Color value)
Creates a new color chooser dialog. If a frame is specified, the dialog is created using ColorChooserDialog.

Parameters:

frame
The parent frame of the color chooser dialog box.
title
The title text of the color chooser dialog box, usually shown in the title bar.
value
The active color value.


ColorChooser properties

frame

 public Frame getFrame()
 public void setFrame(java.awt.Frame frame)
The parent frame of the color chooser dialog box.

result

 public int getResult()
 public void setResult(int i)
Uses jbcl.control.ButtonDialog.setResult() or getResult(), to determine whether OK or Cancel was clicked. (See the result property, not the result variable, in that file.)

title

 public String getTitle()
 public void setTitle(java.lang.String title)
The title text of the color chooser dialog box, usually shown in the title bar.

value

 public Color getValue()
 public void setValue(java.awt.Color value)
The active color value. Typically, this value determines the color that is initially displayed when the dialog box appears.

visible

 public boolean isVisible()
 public void setVisible(boolean visible)
The visible property stores whether this ColorChooser is visible. true, by default.

Returns java.awt.Component.isVisible() for this dialog box. If this dialog box is null, returns false.


ColorChooser methods

show()

  public void show()
Displays a color chooser dialog box (if the default constructor was invoked), registers itself as a window listener for the dialog box, and shows the dialog using java.awt.Dialog.show().


ColorChooser event listeners

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

action

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