|
Préférences
Moteurs de recherche
|
||||||||||||||||||||||||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.6.0
javax.swing
|
Method Summary | |
---|---|
void |
addActionListener(ActionListener l)
Adds an ActionListener to the model. |
void |
addChangeListener(ChangeListener l)
Adds a ChangeListener to the model. |
void |
addItemListener(ItemListener l)
Adds an ItemListener to the model. |
String |
getActionCommand()
Returns the action command string for the button. |
int |
getMnemonic()
Gets the keyboard mnemonic for the button. |
boolean |
isArmed()
Indicates partial commitment towards triggering the button. |
boolean |
isEnabled()
Indicates if the button can be selected or triggered by an input device, such as a mouse pointer. |
boolean |
isPressed()
Indicates if the button is pressed. |
boolean |
isRollover()
Indicates that the mouse is over the button. |
boolean |
isSelected()
Indicates if the button has been selected. |
void |
removeActionListener(ActionListener l)
Removes an ActionListener from the model. |
void |
removeChangeListener(ChangeListener l)
Removes a ChangeListener from the model. |
void |
removeItemListener(ItemListener l)
Removes an ItemListener from the model. |
void |
setActionCommand(String s)
Sets the action command string that gets sent as part of the ActionEvent when the button is triggered. |
void |
setArmed(boolean b)
Marks the button as armed or unarmed. |
void |
setEnabled(boolean b)
Enables or disables the button. |
void |
setGroup(ButtonGroup group)
Identifies the group the button belongs to -- needed for radio buttons, which are mutually exclusive within their group. |
void |
setMnemonic(int key)
Sets the keyboard mnemonic (shortcut key or accelerator key) for the button. |
void |
setPressed(boolean b)
Sets the button to pressed or unpressed. |
void |
setRollover(boolean b)
Sets or clears the button's rollover state |
void |
setSelected(boolean b)
Selects or deselects the button. |
Methods inherited from interface java.awt.ItemSelectable |
---|
getSelectedObjects |
Method Detail |
---|
boolean isArmed()
true
if the button is armed,
and ready to be triggeredsetArmed(boolean)
boolean isSelected()
true
if the button is selectedboolean isEnabled()
true
if the button is enabledboolean isPressed()
true
if the button is pressedboolean isRollover()
true
if the mouse is over the buttonvoid setArmed(boolean b)
b
- whether or not the button should be armedvoid setSelected(boolean b)
b
- true
selects the button,
false
deselects the buttonvoid setEnabled(boolean b)
b
- whether or not the button should be enabledisEnabled()
void setPressed(boolean b)
b
- whether or not the button should be pressedisPressed()
void setRollover(boolean b)
b
- whether or not the button is in the rollover stateisRollover()
void setMnemonic(int key)
key
- an int specifying the accelerator keyint getMnemonic()
setMnemonic(int)
void setActionCommand(String s)
ActionEvent
when the button is triggered.
s
- the String
that identifies the generated eventgetActionCommand()
,
ActionEvent.getActionCommand()
String getActionCommand()
String
that identifies the generated eventsetActionCommand(java.lang.String)
void setGroup(ButtonGroup group)
group
- the ButtonGroup
the button belongs tovoid addActionListener(ActionListener l)
ActionListener
to the model.
l
- the listener to addvoid removeActionListener(ActionListener l)
ActionListener
from the model.
l
- the listener to removevoid addItemListener(ItemListener l)
ItemListener
to the model.
addItemListener
in interface ItemSelectable
l
- the listener to addItemEvent
void removeItemListener(ItemListener l)
ItemListener
from the model.
removeItemListener
in interface ItemSelectable
l
- the listener to removeItemEvent
void addChangeListener(ChangeListener l)
ChangeListener
to the model.
l
- the listener to addvoid removeChangeListener(ChangeListener l)
ChangeListener
from the model.
l
- the listener to remove