borland Packages  Class Hierarchy  jbcl.control Package  Index 

CheckboxPanel component

java.lang.Object
   +----java.awt.Component
           +----java.awt.Container
                   +----com.sun.java.swing.JComponent
                           +----borland.jbcl.view.BeanPanel
                                   +----borland.jbcl.control.BevelPanel
                                           +----borland.jbcl.control.CheckboxPanel

About the CheckboxPanel component

Variables  Constructors  Properties  Methods  Event Listeners

Implements BlackBox, ImageObserver, MenuContainer, Serializable

The CheckboxPanel simplifies the layout of a group of check boxes on a panel. As with regular check boxes, more than one check box on the panel can be checked at a time. If the grouped property is true, however, the check boxes appear as radio buttons and only one at a time can be selected.

Each string specified with the labels property becomes a check box (or radio button) on the panel labeled with the specified string. The labeled check boxes are evenly spaced on the panel. The value of the orientation property determines whether the check boxes are displayed horizontally or vertically.

The value of selectedLabels determines which check boxes are checked if they aren't grouped. If they are grouped, the selectedLabel property contains the value of the selected radio button. The selectedIndex property reports which check box is currently selected.

To add a check box to the panel, call the addLabel() method. To access a check box, call the getLabel() method. Use the setLabel() method to modify the label of a specified check box.

CheckboxPanel extends BevelPanel that has several properties that determine the appearance of the CheckboxPanel. For more information, see the BevelPanel component.

 


CheckboxPanel variables

Variables implemented in this class

Variables implemented in borland.jbcl.control.BevelPanel

Variables implemented in borland.jbcl.view.BeanPanel

Variables implemented in com.sun.java.swing.JComponent

Variables implemented in java.awt.Component

CheckboxPanel constructors

CheckboxPanel properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in borland.jbcl.control.BevelPanel

Properties implemented in borland.jbcl.view.BeanPanel

Properties implemented in com.sun.java.swing.JComponent

Properties implemented in java.awt.Component

Properties implemented in java.awt.Container

Properties implemented in java.lang.Object

CheckboxPanel methods

Methods implemented in this class

Methods implemented in borland.jbcl.control.BevelPanel

Methods implemented in borland.jbcl.view.BeanPanel

Methods implemented in com.sun.java.swing.JComponent

Methods implemented in java.awt.Component

Methods implemented in java.awt.Container

Methods implemented in java.lang.Object

CheckboxPanel event listeners


CheckboxPanel variables

textureName

  protected String textureName

CheckboxPanel constructors

CheckboxPanel()

  public CheckboxPanel()

Constructs a CheckboxPanel with default property values. The panel is created empty; you must add CheckboxControl components to it before using it. The default property values are listed in the following table.
Property Value
layout GridLayout
orientation vertical
insets 6 pixels


CheckboxPanel properties

background

 public void setBackground(java.awt.Color color)
Sets the background color to the color specified with the color parameter.

enabled

 public void setEnabled(boolean enabled)

font

 public void setFont(java.awt.Font font)
Sets the font used for the labels to the font specified with the font parameter.

foreground

 public void setForeground(java.awt.Color color)
Sets the color used for the labels to the color specified with the color parameter.

grouped

 public boolean isGrouped()
 public void setGrouped(boolean grouped)
Determines whether the checkboxes are actually radio buttons so that only one can be checked at any time. If grouped is true, the checkboxes are radio buttons.

labels

 public String[] getLabels()
 public void setLabels(java.lang.String[] labels)

An array of String labels for each item in the CheckboxPanel.

layout

 public void setLayout(java.awt.LayoutManager layout)

The layout manager used for the CheckboxPanel.

orientation

 public int getOrientation()
 public void setOrientation(int o)

The orientation of the CheckboxPanel. Valid values for orientation are defined in borland.jbcl.util.Orientation variables.

selectedIndex

 public int getSelectedIndex()
 public void setSelectedIndex(int index)

The index of the selected checkbox, if grouped.

selectedLabel

 public String getSelectedLabel()
 public void setSelectedLabel(java.lang.String label)

The selected checkbox item, if grouped.

selectedLabels

 public String[] getSelectedLabels()
 public void setSelectedLabels(java.lang.String[] selectedLabels)

The selected checkbox items as an array of strings.

textureName

 public String getTextureName()
 public void setTextureName(java.lang.String path)
Determines the name of the Image file that is tiled on the background of the control to give the appearance of texture. Specify the file name and directory using the path parameter.

CheckboxPanel methods

addLabel(java.lang.String)

  public void addLabel(java.lang.String label)

Adds a new CheckboxControl component with the specified label to the panel.

Parameters:

label
The label of the checkbox item.

getLabel(int)

  public String getLabel(int index)

Returns the label of the CheckboxControl component at the location in the list specified by index.

Parameters:

index
The position of the checkbox item in the list.

setLabel(int, java.lang.String)

  public void setLabel(int index, java.lang.String label)

Sets the label of the CheckboxControl at the specified index location to the value specified by label.

Parameters:

index
The position of the checkbox item in the list.
label
The label of the checkbox item.

CheckboxPanel 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 synchronized void addActionListener(java.awt.event.ActionListener l)
 public synchronized void removeActionListener(java.awt.event.ActionListener l)

ancestor

 public void addAncestorListener(com.sun.java.swing.event.AncestorListener )
 public void removeAncestorListener(com.sun.java.swing.event.AncestorListener )

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 void addFocusListener(java.awt.event.FocusListener l)
 public void removeFocusListener(java.awt.event.FocusListener l)

item

 public void addItemListener(java.awt.event.ItemListener l)
 public void removeItemListener(java.awt.event.ItemListener l)

key

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

mouse

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

mouseMotion

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

propertyChange

 public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener )
 public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )

vetoableChange

 public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener )
 public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )