public class ToggleButtonModel
extends javax.swing.JToggleButton.ToggleButtonModel
| Constructor and Description |
|---|
ToggleButtonModel(java.lang.String text,
javax.swing.Icon icon,
java.lang.String shortdesc)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
javax.swing.JToggleButton |
createButton()
Creates and returns a normal button using this model.
|
javax.swing.JCheckBox |
createCheckBox()
Creates and returns a check box using this model.
|
javax.swing.JCheckBoxMenuItem |
createMenuItem()
Creates and returns a menu item using this model.
|
javax.swing.JRadioButton[] |
createRadioButtons(java.lang.String name0,
java.lang.String name1)
Creates and returns a pair of radio buttons using this model.
|
javax.swing.JToggleButton |
createToolbarButton()
Creates and returns a button suitable for use in a toolbar using
this model.
|
void |
fireActionPerformed(java.awt.event.ActionEvent evt) |
java.lang.String |
getDescription()
Returns the description (for tooltips etc) associated with this model.
|
javax.swing.Icon |
getIcon()
Returns the icon associated with this model.
|
java.lang.String |
getText()
Returns the text label associated with this model.
|
boolean |
isSelected()
Returns the state of this model.
|
void |
setDescription(java.lang.String shortdesc)
Sets the description (for tooltips etc) associated with this model.
|
void |
setIcon(javax.swing.Icon icon)
Sets the icon associated with this model.
|
void |
setSelected(boolean state)
Sets the state of this model.
|
void |
setText(java.lang.String text)
Sets the text label associated with this model.
|
addActionListener, addChangeListener, addItemListener, fireItemStateChanged, fireStateChanged, getActionCommand, getActionListeners, getChangeListeners, getGroup, getItemListeners, getListeners, getMnemonic, getSelectedObjects, isArmed, isEnabled, isPressed, isRollover, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setRolloverpublic ToggleButtonModel(java.lang.String text,
javax.swing.Icon icon,
java.lang.String shortdesc)
text - text to be used on buttons etcicon - icon to be used on buttons etcshortdesc - short description to be used for tool tips etcpublic void setText(java.lang.String text)
text - button namepublic java.lang.String getText()
public void setIcon(javax.swing.Icon icon)
icon - button iconpublic javax.swing.Icon getIcon()
public void setDescription(java.lang.String shortdesc)
shortdesc - descriptionpublic java.lang.String getDescription()
public javax.swing.JToggleButton createButton()
public javax.swing.JToggleButton createToolbarButton()
public javax.swing.JCheckBoxMenuItem createMenuItem()
public javax.swing.JCheckBox createCheckBox()
public javax.swing.JRadioButton[] createRadioButtons(java.lang.String name0,
java.lang.String name1)
name0 - name of the Off controlname1 - name of the On controlpublic void setSelected(boolean state)
setSelected in interface javax.swing.ButtonModelsetSelected in class javax.swing.JToggleButton.ToggleButtonModelstate - on/off statuspublic boolean isSelected()
isSelected in interface javax.swing.ButtonModelisSelected in class javax.swing.JToggleButton.ToggleButtonModelpublic void fireActionPerformed(java.awt.event.ActionEvent evt)
fireActionPerformed in class javax.swing.DefaultButtonModelCopyright ? 2003-2017 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.