Class org.aswing.JLabel

Description

Field Index

BOTTOM, CENTER, HORIZONTAL, LEFT, RIGHT, TOP, VERTICAL

Inherited from Component

Inherited from EventDispatcher

Method Index

new JLabel()
getDisabledIcon(), getHorizontalAlignment(), getHorizontalTextPosition(), getIcon(), getIconTextGap(), getText(), getUIClassID(), getVerticalAlignment(), getVerticalTextPosition(), setContent(), setDisabledIcon(), setHorizontalAlignment(), setHorizontalTextPosition(), setIcon(), setIconTextGap(), setText(), setUI(), setVerticalAlignment(), setVerticalTextPosition(), updateUI()

Inherited from Component

Inherited from EventDispatcher

Constructor Detail

JLabel

function JLabel(text, icon, horizontalAlignment:Number)

JLabel(text:String, icon:Icon, horizontalAlignment:Number)
JLabel(text:String, icon:Icon)
JLabel(text:String, horizontalAlignment:Number)
JLabel(text:String)
JLabel(icon:Icon, horizontalAlignment:Number)
JLabel(icon:Icon)
JLabel()

Field Detail

CENTER

static public CENTER:Number
A fast access to ASSwingConstants Constant

See Also

  • org.aswing.ASSwingConstants

TOP

static public TOP:Number
A fast access to ASWingConstants Constant

See Also

LEFT

static public LEFT:Number
A fast access to ASWingConstants Constant

See Also

BOTTOM

static public BOTTOM:Number
A fast access to ASWingConstants Constant

See Also

RIGHT

static public RIGHT:Number
A fast access to ASWingConstants Constant

See Also

HORIZONTAL

static public HORIZONTAL:Number
A fast access to ASWingConstants Constant

See Also

VERTICAL

static public VERTICAL:Number
A fast access to ASWingConstants Constant

See Also

Method Detail

updateUI

public function updateUI():Void

Description copied from Component

Resets the UI property to a value from the current look and feel. Component subclasses must override this method like this:

   public void updateUI() {
      setUI((SliderUI)UIManager.getUI(this);
   }
  

Overrides

updateUI() in org.aswing.Component

setUI

public function setUI(newUI:LabelUI):Void

Description copied from Component

Sets the look and feel delegate for this component. Component subclasses generally override this method to narrow the argument type. For example, in JSlider:

 public void setUI(SliderUI newUI) {
     super.setUI(newUI);
 }
  

Additionally Component subclasses must provide a getUI method that returns the correct type. For example:

 public SliderUI getUI() {
     return (SliderUI)ui;
 }
 

Overrides

setUI() in org.aswing.Component

getUIClassID

public function getUIClassID():String

Description copied from Component

Returns the UIDefaults key used to look up the name of the org.aswing.plaf.ComponentUI class that defines the look and feel for this component. Most applications will never need to call this method. Subclasses of Component that support pluggable look and feel should override this method to return a UIDefaults key that maps to the ComponentUI subclass that defines their look and feel.

Overrides

getUIClassID() in org.aswing.Component

setContent

public function setContent(text:String, icon:Icon):Void

Sets text and icon at one method here.

Parameters

textthe text for the label
iconthe default icon for the label

See Also

setText

public function setText(text:String):Void

getText

public function getText():String

setIcon

public function setIcon(icon:Icon):Void

getIcon

public function getIcon():Icon

getDisabledIcon

public function getDisabledIcon():Icon

Returns the icon used by the label when it's disabled. If no disabled icon has been set, the button constructs one from the default icon if defalut icon setted. otherwish return null;

The disabled icon really should be created (if necessary) by the L&F.-->

Return

the disabledIcon property

See Also

setDisabledIcon

public function setDisabledIcon(disabledIcon:Icon):Void

Sets the disabled icon for the label.

Parameters

disabledIconthe icon used as the disabled image

See Also

getVerticalAlignment

public function getVerticalAlignment():Number

Returns the vertical alignment of the text and icon.

Return

the verticalAlignment property, one of the following values:

  • ASWingConstants.CENTER (the default)
  • ASWingConstants.TOP
  • ASWingConstants.BOTTOM

setVerticalAlignment

public function setVerticalAlignment(alignment:Number):Void

Sets the vertical alignment of the icon and text.

Parameters

alignmentone of the following values:
  • ASWingConstants.CENTER (the default)
  • ASWingConstants.TOP
  • ASWingConstants.BOTTOM

getHorizontalAlignment

public function getHorizontalAlignment():Number

Returns the horizontal alignment of the icon and text.

Return

the horizontalAlignment property, one of the following values:

  • ASWingConstants.RIGHT (the default)
  • ASWingConstants.LEFT
  • ASWingConstants.CENTER

setHorizontalAlignment

public function setHorizontalAlignment(alignment:Number):Void

Sets the horizontal alignment of the icon and text.

Parameters

alignmentone of the following values:
  • ASWingConstants.RIGHT (the default)
  • ASWingConstants.LEFT
  • ASWingConstants.CENTER

getVerticalTextPosition

public function getVerticalTextPosition():Number

Returns the vertical position of the text relative to the icon.

Return

the verticalTextPosition property, one of the following values:

  • ASWingConstants.CENTER (the default)
  • ASWingConstants.TOP
  • ASWingConstants.BOTTOM

setVerticalTextPosition

public function setVerticalTextPosition(textPosition:Number):Void

Sets the vertical position of the text relative to the icon.

Parameters

getHorizontalTextPosition

public function getHorizontalTextPosition():Number

Returns the horizontal position of the text relative to the icon.

Return

the horizontalTextPosition property, one of the following values:

  • ASWingConstants.RIGHT (the default)
  • ASWingConstants.LEFT
  • ASWingConstants.CENTER

setHorizontalTextPosition

public function setHorizontalTextPosition(textPosition:Number):Void

Sets the horizontal position of the text relative to the icon.

Parameters

textPositionone of the following values:
  • ASWingConstants.RIGHT (the default)
  • ASWingConstants.LEFT
  • ASWingConstants.CENTER

getIconTextGap

public function getIconTextGap():Number

Returns the amount of space between the text and the icon displayed in this button.

Return

an int equal to the number of pixels between the text and the icon.

See Also

setIconTextGap

public function setIconTextGap(iconTextGap:Number):Void

If both the icon and text properties are set, this property defines the space between them.

The default value of this property is 4 pixels.

See Also