Class AwtUIPushButton
public class AwtUIPushButton extends AwtUIButton
{
// Constructors
public AwtUIPushButton();
public AwtUIPushButton(String text);
public AwtUIPushButton(String text, int style);
public AwtUIPushButton(IUIComponent comp);
public AwtUIPushButton(IUIComponent comp, int style);
// Methods
public void addActionListener(ActionListener l);
public IUIComponent getBase();
protected void processActionEvent(ActionEvent e);
protected void processHostEvent(AWTEvent e);
public synchronized void removeActionListener(ActionListener l);
}
This class implements the functionality of a UIPushButton object in an AWT-based control. An AwtUIPushButton control is an AwtUIHost component whose associated root container holds a UIPushButton object. By hosting this object, an AwtUIPushButton control integrates AFC with AWT. Although an AwtUIPushButton control is fully compatible with AWT, a UIPushButton control is optimized for performance and size.
Note The hot-track color is the same color as the button text color. As a result, hot-tracking does not appear to be functional.
Panel
|
+--AwtUIHost
|
+--AwtUIControl
|
+--AwtUIButton
|
+--AwtUIPushButton
public AwtUIPushButton();
Creates an AWT-based push button control with no content.
Remarks:
By default, the button's style is RAISED.
public AwtUIPushButton(String text);
Creates an AWT-based push button control with the specified text.
Parameter | Description |
text
| The text to be displayed within the button.
|
Remarks:
By default, the button is hot-tracked and has a flat style. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.
public AwtUIPushButton(String text, int style);
Creates an AWT-based push button control with the specified text and style.
Remarks:
By default, the button is hot-tracked. To create a button that is not hot-tracked, pass a UIText object instead of a String. For more information about hot-tracking, see the UIButton overview.
Exceptions:
IllegalArgumentException
if an undefined style was specified.
public AwtUIPushButton(IUIComponent comp);
Creates an AWT-based push button control with the specified component.
Parameter | Description |
comp
| The component to be displayed within the button.
|
Remarks:
Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. By default, the button's style is RAISED. For examples of how to construct buttons, see the UIButton overview.
public AwtUIPushButton(IUIComponent comp, int style);
Creates an AWT-based push button control with the specified component and style.
Remarks:
Typically, you'll pass a UIText, UIGraphic, or UIItem object for the component. For examples of how to construct buttons, see the UIButton overview.
Exceptions:
IllegalArgumentException
if an undefined style was specified.
public void addActionListener(ActionListener l);
Adds the specified action listener. The listener receives all action events generated for the control.
Return Value:
No return value.
Parameter | Description |
l
| The action listener to be added.
|
See Also: removeActionListener
public IUIComponent getBase();
Retrieves the UI component that the button is based on.
Return Value:
Returns the UIPushButton object associated with the button control.
Remarks:
When the AWT-based button is first created, it is associated with a UIPushButton object.
protected void processActionEvent(ActionEvent e);
Processes action events.
Return Value:
No return value.
Parameter | Description |
e
| The action event.
|
Remarks:
This method is called by processHostEvent and dispatches the event to a registered action listener. When overriding this method, call the super method processActionEvent to ensure the default event processing continues normally.
See Also: addActionListener
protected void processHostEvent(AWTEvent e);
Processes the specified event.
Return Value:
No return value.
Parameter | Description |
e
| The event.
|
Remarks:
This method is automatically invoked if a listener has has been registered through a call to addXXXListener. Depending on the type of event, processHostEvent calls one of the methods in the following table.
When overriding processHostEvent, call the super method processHostEvent to ensure the default event processing continues normally.
public synchronized void removeActionListener(ActionListener l);
Removes the specified action listener. The listener no longer receives the control's action events.
Return Value:
No return value.
Parameter | Description |
l
| The action listener to be removed.
|
See Also: addActionListener