JTextField

Methods
11
Fields
1

Getting one

JTextField.new(…)
FlatTextField.new():getTextField()

Methods

MethodReturnsDescription
addActionListener(any)()Adds an ActionListener (a table with actionPerformed, or a function of the event): Enter in the field runs it, the last added first.
removeActionListener(any)()Removes an ActionListener, by identity.
getActionListeners(){any}A copy of the ActionListeners, in registration order.
setActionCommand(string?)()The command its ActionEvents carry (the text, when none is set).
getColumns()numberThe width in columns (0: as wide as the text).
setColumns(number)()Sets the width in columns; the field is laid out again.
getHorizontalAlignment()numberThe text's horizontal alignment.
setHorizontalAlignment(number)()Aligns the text (JTextField.LEFT, CENTER, RIGHT, LEADING, TRAILING).
new(string?)JTextField() -> JTextField: An empty field.
new(number)JTextField
new(string?, number)JTextField
init(JTextField, string?)()(JTextField) -> (): An empty field.
init(JTextField, number)()
init(JTextField, string?, number)()
isInstance(any)booleanWhether obj is a JTextField object, a class(JTextField) subclass's included.

Fields

FieldTypeDescription
superJTextComponentClassJTextComponent's class table: the base class.

Returned by

MethodReturnsDescription
FlatTextField.getTextFieldJTextFieldThe JTextField inside.
JTextFieldClass.newJTextField() -> JTextField: An empty field.

Method details

addActionListener

addActionListener: (JTextField, any) -> ()

Adds an ActionListener (a table with actionPerformed, or a function of the event): Enter in the field runs it, the last added first.

setColumns

setColumns: (JTextField, number) -> ()

Sets the width in columns; the field is laid out again.

new

new: ((string?) -> JTextField) & ((number) -> JTextField) & ((string?, number) -> JTextField)

() -> JTextField: An empty field.

(string?) -> JTextField: A field showing text.

(number) -> JTextField: An empty field columns wide.

(string?, number) -> JTextField: A field showing text, columns wide.

init

init: ((JTextField, string?) -> ()) & ((JTextField, number) -> ()) & ((JTextField, string?, number) -> ())

(JTextField) -> (): An empty field.

(JTextField, string?) -> (): A field showing text.

(JTextField, number) -> (): An empty field columns wide.

(JTextField, string?, number) -> (): A field showing text, columns wide.

isInstance

isInstance: (any) -> boolean

Whether obj is a JTextField object, a class(JTextField) subclass's included.