static public ON_SET_FOCUS:Stringstatic public ON_KILL_FOCUS:Stringstatic public ON_STATE_CHANGED:Stringstatic public ON_SELECTION_CHANGED:Stringstatic public CENTER:Numberstatic public TOP:Numberstatic public LEFT:Numberstatic public BOTTOM:Numberstatic public RIGHT:Numberstatic public HORIZONTAL:Numberstatic public VERTICAL:Numberpublic function setUI(ui:ButtonUI):VoidSets the L&F object that renders this component.
ui | the ButtonUI L&F object
|
setUI() in org.aswing.Component
public function updateUI():Void
Resets the UI property to a value from the current look
and feel. Subtypes of AbstractButton
should override this to update the UI. For
example, JButton might do the following:
setUI(ButtonUI(UIManager.getUI(this)));
public function addActionListener(fuc:Function, obj:Object):Object
addActionListener(fuc:Function, obj:Object)
addActionListener(fuc:Function)
Adds a action listener to this button. Buttons fire a action event when user released on it.
fuc | the listener function. |
the listener just added.
public function addSelectionListener(func:Function, obj:Object):Object
addSelectionListener(fuc:Function, obj:Object)
addSelectionListener(fuc:Function)
Adds a action listener to this button's selection change event.
the listener just added.
public function setEnabled(b:Boolean):VoidEnabled (or disabled) the button.
b | true to enable the button, otherwise false |
public function isSelected():BooleanReturns the state of the button. True if the toggle button is selected, false if it's not.
true if the toggle button is selected, otherwise false
public function setSelected(b:Boolean):Void
Sets the state of the button. Note that this method does not
trigger an Event for users.
Call doClick to perform a programatic action change.
b | true if the button is selected, otherwise false |
public function setRollOverEnabled(b:Boolean):Void
Sets the rolloverEnabled property, which
must be true for rollover effects to occur.
The default value for the rolloverEnabled
property is false.
Some look and feels might not implement rollover effects;
they will ignore this property.
b | if true, rollover effects should be painted
|
public function isRollOverEnabled():Boolean
Gets the rolloverEnabled property.
the value of the rolloverEnabled property
public function setMargin(m:Insets):Void
Sets space for margin between the button's border and
the label. Setting to null will cause the button to
use the default margin. The button's default Border
object will use this value to create the proper margin.
However, if a non-default border is set on the button,
it is that Border object's responsibility to create the
appropriate margin space (else this property will
effectively be ignored).
m | the space between the border and the label |
public function setPressedIcon(pressedIcon:Icon):VoidSets the pressed icon for the button.
pressedIcon | the icon used as the "pressed" image |
public function getSelectedIcon():IconReturns the selected icon for the button.
the selectedIcon property
public function setSelectedIcon(selectedIcon:Icon):VoidSets the selected icon for the button.
selectedIcon | the icon used as the "selected" image |
public function getRollOverIcon():IconReturns the rollover icon for the button.
the rolloverIcon property
public function setRollOverIcon(rolloverIcon:Icon):VoidSets the rollover icon for the button.
rolloverIcon | the icon used as the "rollover" image |
public function getRollOverSelectedIcon():IconReturns the rollover selection icon for the button.
the rolloverSelectedIcon property
public function setRollOverSelectedIcon(rolloverSelectedIcon:Icon):VoidSets the rollover selected icon for the button.
rolloverSelectedIcon | the icon used as the "selected rollover" image |
public function getDisabledIcon():IconReturns the icon used by the button when it's disabled. If no disabled icon has been set, the button constructs one from the default icon.
The disabled icon really should be created (if necessary) by the L&F.-->
the disabledIcon property
public function setDisabledIcon(disabledIcon:Icon):VoidSets the disabled icon for the button.
disabledIcon | the icon used as the disabled image |
public function getDisabledSelectedIcon():IconReturns the icon used by the button when it's disabled and selected. If not no disabled selection icon has been set, the button constructs one from the selection icon.
The disabled selection icon really should be created (if necessary) by the L&F. -->
the disabledSelectedIcon property
public function setDisabledSelectedIcon(disabledSelectedIcon:Icon):VoidSets the disabled selection icon for the button.
disabledSelectedIcon | the icon used as the disabled selection image |
public function getVerticalAlignment():NumberReturns the vertical alignment of the text and icon.
the verticalAlignment property, one of the
following values:
public function setVerticalAlignment(alignment:Number):VoidSets the vertical alignment of the icon and text.
alignment | one of the following values:
|
public function getHorizontalAlignment():NumberReturns the horizontal alignment of the icon and text.
the horizontalAlignment property,
one of the following values:
public function setHorizontalAlignment(alignment:Number):VoidSets the horizontal alignment of the icon and text.
alignment | one of the following values:
|
public function getVerticalTextPosition():NumberReturns the vertical position of the text relative to the icon.
the verticalTextPosition property,
one of the following values:
public function setVerticalTextPosition(textPosition:Number):VoidSets the vertical position of the text relative to the icon.
public function getHorizontalTextPosition():NumberReturns the horizontal position of the text relative to the icon.
the horizontalTextPosition property,
one of the following values:
public function setHorizontalTextPosition(textPosition:Number):VoidSets the horizontal position of the text relative to the icon.
textPosition | one of the following values:
|
public function getIconTextGap():NumberReturns the amount of space between the text and the icon displayed in this button.
an int equal to the number of pixels between the text and the icon.