borland Packages  Class Hierarchy  dbswing Package 

RepeatButton component

java.lang.Object
   +----java.awt.Component
           +----java.awt.Container
                   +----javax.swing.JComponent
                           +----javax.swing.AbstractButton
                                   +----javax.swing.JButton
                                           +----com.borland.dbswing.RepeatButton

About the RepeatButton component

Variables  Constructors  Properties  Methods  Event Listeners

Implements ActionListener, FocusListener, ImageObserver, ItemSelectable, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, SwingConstants

Note: This is a feature of JBuilder Professional and Enterprise.

RepeatButton is a fully-interchangeable subclass of JButton. It adds the following properties:


RepeatButton variables

Variables implemented in java.awt.Component

Variables implemented in javax.swing.AbstractButton

Variables implemented in javax.swing.JComponent

RepeatButton constructors

RepeatButton properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.awt.Component

Properties implemented in java.awt.Container

Properties implemented in java.lang.Object

Properties implemented in javax.swing.AbstractButton

Properties implemented in javax.swing.JButton

Properties implemented in javax.swing.JComponent

RepeatButton methods

Methods implemented in this class

Methods implemented in java.awt.Component

Methods implemented in java.awt.Container

Methods implemented in java.lang.Object

Methods implemented in javax.swing.AbstractButton

Methods implemented in javax.swing.JButton

Methods implemented in javax.swing.JComponent

RepeatButton event listeners


RepeatButton constructors

RepeatButton()

  public RepeatButton()
Constructs a RepeatButton with no specified text or icon. Calls the constructor of this class that takes a String and an Icon as parameters. Passes null and null to the other constructor.

RepeatButton(java.lang.String)

  public RepeatButton(String text)
Constructs a RepeatButton with a specified text string that appears on the button face. Calls the constructor of this class that takes a String and an Icon as parameters. Passes text and null to the other constructor.

Parameters:

text
The text string that appears on the button.

RepeatButton(java.lang.String, javax.swing.Icon)

  public RepeatButton(String text, Icon icon)
Constructs a RepeatButton with a specified text string and icon that appears on the button face. Calls the constructor of its superclass that takes a String and an Icon as parameters.

Parameters:

text
The text string that appears on the button face.
icon
The icon that appears on the button face.

RepeatButton(javax.swing.Icon)

  public RepeatButton(Icon icon)
Constructs a RepeatButton with a specified icon that appears on the button face. Calls the constructor of this class that takes a String and an Icon as parameters. Passes null and icon to the other constructor.

Parameters:

icon
The icon that appears on the button face.

RepeatButton properties

defaultButton

 public void setDefaultButton(boolean defaultButton)
Returns and sets whether this button should be its container's default button. Note that there can only be one default button within a window. If more than one button in the same container has this property set to true, the button which was most recently set to be the default button takes precedence. Also, note that default button behavior is look-and-feel dependent.

Because default button behavior is implemented by a JRootPane object, this property is useful only when a RepeatButton is placed within a Swing container with a JRootPane (for example, JFrame).

defaultButton is a bound property, and therefore fires a property change event when modified.

Setting this property to true has the side effect of setting the defaultCapable property to true if it is false.

Note that the while the setter or write access method for defaultButton is in RepeatButton, the getter or read access method is in its parent, JButton; defaultButton is both a read and write property.

initialDelay

 public int getInitialDelay()
 public void setInitialDelay(int initialDelay)
Returns and sets the interval, in milliseconds, after which repeated ActionEvents are fired. The default initial delay is 400 milliseconds. initialDelay is a bound property, and therefore it fires a property change event when its value is modified.

To have initialDelay take effect, the repeat property value must be true.

See also: repeat, repeatDelay

repeat

 public boolean isRepeat()
 public void setRepeat(boolean repeat)
Returns and sets whether ActionEvents are fired repeatedly when the button is held down. This property is false by default. repeat is a bound property, and therefore it fires a property change event when its value is modified.

See also: repeatDelay

repeatDelay

 public int getRepeatDelay()
 public void setRepeatDelay(int repeatDelay)
Returns and sets the interval, in milliseconds, at which repeated ActionEvents are fired. The default interval is 200 milliseconds. repeatDelay is a bound property, and therefore it fires a property change event when its value is modified.

To have repeatDelay take effect, the repeat property value must be true.

See also: repeat, initialDelay

textWithMnemonic

 public String getTextWithMnemonic()
 public void setTextWithMnemonic(String text)

textWithMnemonic is a convenience property for setting the button's text, which interprets an ampersand character (&) within the text as an instruction to make the character following the ampersand the mnemonic character for the button. To put an ampersand in the text but not make the character following it a hot key, put a backslash before the ampersand. To make a literal ampersand the hot key, put two consecutive ampersands in the text.

When the String entered is displayed in the Inspector and as the button's text in design mode and at runtime, the ampersand is removed and the hot key character is underlined.

This property can be used instead of the usual text property, even if a mnemonic character is not embedded in the text. It is particularly useful for applications that resource strings for internationalization, because the text and mnemonic can be specified in a single string.

Note that the first occurrence of the mnemonic character is always denoted visibly as the mnemonic key, despite the location of the ampersand within the text. Furthermore, only the first occurrence of an ampersand is removed from the text.

When textWithMnemonic is set, both the text and textWithMnemonic properties are updated. If both the text and textWithMnemonic properties are set, the most recently set property takes precedence.

textWithMnemonic is a bound property, and therefore a property change event is fired when its value is modified.


RepeatButton methods

addNotify()

  public void addNotify()
Sets this button as the default button when the button's peer is created.

Overrides: javax.swing.JComponent.addNotify()

processMouseEvent(java.awt.event.MouseEvent)

  protected void processMouseEvent(MouseEvent e)

Overrides: java.awt.Component.processMouseEvent(java.awt.event.MouseEvent)


RepeatButton event listeners

This component is a source for the following event sets.

action

 public void addActionListener(java.awt.event.ActionListener )
 public void removeActionListener(java.awt.event.ActionListener )

ancestor

 public void addAncestorListener(javax.swing.event.AncestorListener )
 public void removeAncestorListener(javax.swing.event.AncestorListener )

change

 public void addChangeListener(javax.swing.event.ChangeListener )
 public void removeChangeListener(javax.swing.event.ChangeListener )

component

 public synchronized void addComponentListener(java.awt.event.ComponentListener )
 public synchronized void removeComponentListener(java.awt.event.ComponentListener )

container

 public synchronized void addContainerListener(java.awt.event.ContainerListener )
 public synchronized void removeContainerListener(java.awt.event.ContainerListener )

focus

 public synchronized void addFocusListener(java.awt.event.FocusListener )
 public synchronized void removeFocusListener(java.awt.event.FocusListener )

inputMethod

 public synchronized void addInputMethodListener(java.awt.event.InputMethodListener )
 public synchronized void removeInputMethodListener(java.awt.event.InputMethodListener )

item

 public void addItemListener(java.awt.event.ItemListener )
 public void removeItemListener(java.awt.event.ItemListener )

key

 public synchronized void addKeyListener(java.awt.event.KeyListener )
 public synchronized void removeKeyListener(java.awt.event.KeyListener )

mouse

 public synchronized void addMouseListener(java.awt.event.MouseListener )
 public synchronized void removeMouseListener(java.awt.event.MouseListener )

mouseMotion

 public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener )
 public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )

propertyChange

 public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener )
 public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )

vetoableChange

 public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener )
 public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )