Class org.aswing.JTextComponent

Description

JTextComponent is the base class for text components.

Field Index

ON_TEXT_CHANGED, ON_TEXT_SCROLLED

Inherited from Component

Inherited from EventDispatcher

Method Index

appendText(), getMaxChars(), getRestrict(), getText(), getTextFormat(), getTextLength(), getUI(), insertText(), isEditable(), isFocused(), isHtml(), isMultiline(), isPasswordField(), isWordWrap(), setEditable(), setEnabled(), setFont(), setHtml(), setMaxChars(), setPasswordField(), setRestrict(), setText(), setTextFormat(), setUI(), updateUI()

Inherited from Component

Inherited from EventDispatcher

Field Detail

ON_TEXT_SCROLLED

static public ON_TEXT_SCROLLED:String
When the text content was scrolled.
onTextScroll Event{source:JTextComponent}

ON_TEXT_CHANGED

static public ON_TEXT_CHANGED:String
When the text content was changed.
onTextChanged Event{source:JTextComponent}

Method Detail

getUI

public function getUI():TextUI

Returns the L&F object that renders this component.

Return

the TextUI object

See Also

setUI

public function setUI(ui:TextUI):Void

Sets the L&F object that renders this component.

Parameters

uithe TextUI L&F object

Overrides

setUI() in org.aswing.Component

See Also

updateUI

public function updateUI():Void

Resets the UI property to a value from the current look and feel. Subtypes of JTextComponent should override this to update the UI. For example, JTextField might do the following:

      setUI(TextUI(UIManager.getUI(this)));
 

isMultiline

public function isMultiline():Boolean

Alwasy return false. Subclass override this to change Text's multiline ability

isWordWrap

public function isWordWrap():Boolean

Subclass override this to change Text's wordWrap ability

setText

public function setText(t:String):Void

Set the text of this text field.(it the textfield enabled html, it will be htmlText)

Parameters

tthe text of this text field, if it is null or undefined, it will be set to "";

See Also

getText

public function getText():String

appendText

public function appendText(t:String):Void

Appends a text to the text's end.

Parameters

tthe text to append.

insertText

public function insertText(t:String, position:Number):Void

Inserts a text to the specified position of current text.

Parameters

tthe text to insert
positionthe position to insert, if it less or equals than 0 means the begin of current text.

setHtml

public function setHtml(enabled:Boolean):Void

Sets whether use html style.

See Also

isHtml

public function isHtml():Boolean

setPasswordField

public function setPasswordField(p:Boolean):Void

isPasswordField

public function isPasswordField():Boolean

setMaxChars

public function setMaxChars(count:Number):Void

getMaxChars

public function getMaxChars():Number

setRestrict

public function setRestrict(r:String):Void

getRestrict

public function getRestrict():String

setEnabled

public function setEnabled(enabled:Boolean):Void

Description copied from Component

Enable or disable the component.

If a component is disabled, it will not fire mouse events. And some component will has different interface when enabled or disabled. But it will also eat mouse clicks when disable even it will not fire mouse events.

Overrides

setEnabled() in org.aswing.Component

setEditable

public function setEditable(editable:Boolean):Void

isEditable

public function isEditable():Boolean

getTextLength

public function getTextLength():Number

Returns the chars of the text.

isFocused

public function isFocused():Boolean

Returns is the textField is focused.

setTextFormat

public function setTextFormat(tf:ASTextFormat):Void

Sets the text format properties for the text component's text format.

The will casue the font changed.

setFont

public function setFont(f:ASFont):Void

Description copied from Component

set the text format for this component.
this method will cause a repaint method call.
If you change to a larger or smaller size format, you may need to call this component's parent to doLayout to make this layout well.

Overrides

setFont() in org.aswing.Component

getTextFormat

public function getTextFormat():ASTextFormat

Returns a copy of the text format of this component.