public class AutoRepeatButtonModel
extends javax.swing.DefaultButtonModel
implements java.awt.event.ActionListener
Constructor and Description |
---|
AutoRepeatButtonModel()
Same as
AutoRepeatButtonModel(int, int) with default init and repeat delays |
AutoRepeatButtonModel(int initDelay,
int repeatDelay)
The repeat mode works like for the keyboard.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
setEnabled(boolean b) |
void |
setPressed(boolean b)
In this model, the action is fired as soon as the button is pressed, not when depressed.
|
void |
stopTimer() |
addActionListener, addChangeListener, addItemListener, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getActionListeners, getChangeListeners, getGroup, getItemListeners, getListeners, getMnemonic, getSelectedObjects, isArmed, isEnabled, isPressed, isRollover, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setGroup, setMnemonic, setRollover, setSelected
public AutoRepeatButtonModel()
AutoRepeatButtonModel(int, int)
with default init and repeat delayspublic AutoRepeatButtonModel(int initDelay, int repeatDelay)
initDelay
another action is fired, then every repeatDelay
, another action is fired again.initDelay
- The delay in milliseconds between the first and the second actionPressedrepeatDelay
- The delay in milliseconds between every actionPressed after the second one.public void setPressed(boolean b)
setPressed
in interface javax.swing.ButtonModel
setPressed
in class javax.swing.DefaultButtonModel
b
- public void setEnabled(boolean b)
setEnabled
in interface javax.swing.ButtonModel
setEnabled
in class javax.swing.DefaultButtonModel
public void stopTimer()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener