buoy.widget

Class BCheckBox


public class BCheckBox
extends Widget

A BCheckBox is a Widget for making simple boolean selections. Clicking it with the mouse toggles it on and off.

In addition to the event types generated by all Widgets, BCheckBoxes generate the following event types:

Author:
Peter Eastman

Constructor Summary

BCheckBox()
Create a new BCheckBox with no label, which is initially deselected.
BCheckBox(String text, boolean state)
Create a new BCheckBox.

Method Summary

Dimension
getMaximumSize()
Get the largest size at which this Widget can reasonably be drawn.
boolean
getState()
Get the selection state of this check box.
String
getText()
Get the text which appears on this check box.
void
setState(boolean selected)
Set the selection state of this check box.
void
setText(String text)
Set the text which appears on this check box.

Methods inherited from class buoy.widget.Widget

addEventLink, dispatchEvent, getBackground, getBounds, getComponent, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible

Methods inherited from class buoy.event.EventSource

addEventLink, addEventLink, addEventLink, dispatchEvent, removeEventLink

Constructor Details

BCheckBox

public BCheckBox()
Create a new BCheckBox with no label, which is initially deselected.

BCheckBox

public BCheckBox(String text,
                 boolean state)
Create a new BCheckBox.
Parameters:
text - the text to display on the BCheckBox
state - the initial selection state of the BCheckBox

Method Details

getMaximumSize

public Dimension getMaximumSize()
Get the largest size at which this Widget can reasonably be drawn. When a WidgetContainer lays out its contents, it will attempt never to make this Widget larger than its maximum size.
Overrides:
getMaximumSize in interface Widget

getState

public boolean getState()
Get the selection state of this check box.

getText

public String getText()
Get the text which appears on this check box.

setState

public void setState(boolean selected)
Set the selection state of this check box.

setText

public void setText(String text)
Set the text which appears on this check box.

Written by Peter Eastman.