Modifier and Type | Method and Description |
---|---|
void |
addActionListener(ActionListener listener)
adds an action listener to the Button.
|
void |
addFocusListener(FocusListener listener)
adds a focus listener to the Button.
|
java.lang.String |
getFieldText()
returns the text in the field.
|
void |
selectAll()
selects all text in the field.
|
void |
setColor(int fore,
int back)
sets the text/font (fore) color and background color
|
void |
setEditable(boolean editable)
sets the text field to editable state ( or not).
|
void |
setFieldText(java.lang.String text)
replaces all the text in the field.
|
setEnabled, setVisible
void addActionListener(ActionListener listener)
The action listener is invoked if the button is clicked and the mouse/finger is released inside the buttons frame.
listener
- the action listener to addvoid addFocusListener(FocusListener listener)
The action listener is invoked if the widget gains or loses keyboard focus.
listener
- the action listener to addjava.lang.String getFieldText()
void setFieldText(java.lang.String text)
text
- the text to replace the field contents withvoid selectAll()
void setEditable(boolean editable)
editable
- true if the field is to be set to editable statevoid setColor(int fore, int back)
fore
- the font colorback
- the background color