|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JToggleButton
NGP.Components.ToggleButton
A simple toggle button. This class models a toggle button and is a subclass of the Swing JToggleButton component. Use it when you want to select individual options that are not exclusive of each other. Very similar to the check box (but this looks like a button, not a box).
RadioButton
,
CheckBox
,
PushButton
,
javax.swing.JToggleButton,
Serialized FormNested Class Summary |
Nested classes inherited from class javax.swing.JToggleButton |
JToggleButton.AccessibleJToggleButton, JToggleButton.ToggleButtonModel |
Nested classes inherited from class javax.swing.AbstractButton |
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
ToggleButton(Container container,
Icon icon)
Construct an unselected toggle button with an icon instead of a string |
|
ToggleButton(Container container,
String name)
Construct an unselected toggle button. |
|
ToggleButton(Container container,
String name,
boolean selected)
Construct a toggle button and leave it selected or unselected according to the boolean. |
Method Summary | |
void |
deselect()
Called when the button is deselected. |
void |
disableSpace()
Disable the Spacebar from activating this component. |
Dimension |
getDimension()
Get the preferred dimensions of this Component. |
void |
select()
Called when the button is selected. |
void |
setDimension(Dimension d)
Set the preferred dimensions of this Component. |
Methods inherited from class javax.swing.JToggleButton |
getAccessibleContext, getUIClassID, paramString, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface NGP.Component |
setEnabled |
Methods inherited from interface NGP.Locatable |
getLocation, setLocation |
Constructor Detail |
public ToggleButton(Container container, String name)
container
- the graphical container for the toggle buttonname
- the String that will be displayed next to the buttonpublic ToggleButton(Container container, Icon icon)
container
- the graphical container for the toggle buttonicon
- the icon that will be displayed on the buttonpublic ToggleButton(Container container, String name, boolean selected)
container
- the graphical container for the toggle buttonname
- the String that will be displayed next to the buttonselected
- Use true
to select the button and
false
to leave it unselected.Method Detail |
public void setDimension(Dimension d)
setDimension
in interface Sizeable
d
- the Dimension
for this Component
.getDimension
public Dimension getDimension()
getDimension
in interface Sizeable
Dimension
of this
Component
.setDimension
public void disableSpace()
public void select()
public void deselect()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |