class org.aswing.JTextComponent extends Component
Interfaces | |||
![]() | EditableComponent |
|
Sub classes | ||||||
![]() | JTextArea, JTextField |
|
JTextComponent is the base class for text components.
JTextComponent
can be formated by ASFont
,
but some times you need complex format,then ASFont
is
not enough, so you can set a EmptyFont
instance to the
JTextComponent
, it will do nothing for the format, then
you can call this.setTextFormat
, this.defaultTextFormat
to format the text with TextFormat
instances. And don't forgot
to call Component.revalidate
if you think the component size should be
change after that. Because these method will not call Component.revalidate
automatically.
@author paling @see #setTextFormat() @see EmptyFont @see JTextField @see JTextArea
Instance Fields
function setTextFormat(tf:TextFormat, ?beginIndex:Int = -1, ?endIndex:Int = -1): Void
Sets the textFormat to the specified range.
You should set a EmptyFont
instance to be the component
font before this call to make sure the textFormat will be effective.
tf | the default textformat. |
beginIndex | the begin index. |
endIndex | the end index. |