| javax.swing.JPanel org.apache.jorphan.gui.JLabeledTextField
All known Subclasses: org.apache.jorphan.gui.JLabeledPasswordField,
JLabeledTextField | public class JLabeledTextField extends JPanel implements JLabeledField,FocusListener(Code) | | A Helper component that wraps a JTextField with a label into a JPanel (this).
This component also has an efficient event handling mechanism for handling
the text changing in the Text Field. The registered change listeners are only
called when the text has changed.
author: S.Coleman version: $Revision: 493784 $ |
JLabeledTextField | public JLabeledTextField()(Code) | | Default constructor, The label and the Text field are left empty.
|
JLabeledTextField | public JLabeledTextField(String pLabel)(Code) | | Constructs a new component with the label displaying the passed text.
Parameters: pLabel - The text to in the label. |
JLabeledTextField | public JLabeledTextField(String pLabel, int size)(Code) | | |
addChangeListener | public void addChangeListener(ChangeListener pChangeListener)(Code) | | Adds a change listener, that will be notified when the text in the text
field is changed. The ChangeEvent that will be passed to registered
listeners will contain this object as the source, allowing the new text
to be extracted using the
JLabeledTextField.getText() getText method.
Parameters: pChangeListener - The listener to add |
focusGained | public void focusGained(FocusEvent pFocusEvent)(Code) | | Catch what the value was when focus was gained.
|
focusLost | public void focusLost(FocusEvent pFocusEvent)(Code) | | Callback method when the focus to the Text Field component is lost.
Parameters: pFocusEvent - The focus event that occured. |
getComponentList | public List getComponentList()(Code) | | |
getLabel | public String getLabel()(Code) | | Returns the text of the label.
The text of the label. |
getText | public String getText()(Code) | | Returns the text in the Text Field.
The text in the Text Field. |
notifyChangeListeners | protected void notifyChangeListeners()(Code) | | Notify all registered change listeners that the text in the text field
has changed.
|
removeChangeListener | public void removeChangeListener(ChangeListener pChangeListener)(Code) | | Removes a change listener.
Parameters: pChangeListener - The change listener to remove. |
setEnabled | public void setEnabled(boolean enable)(Code) | | |
setLabel | public void setLabel(String pLabel)(Code) | | Set the text displayed in the label.
Parameters: pLabel - The new label text. |
setText | public void setText(String pText)(Code) | | Set the text displayed in the Text Field.
Parameters: pText - The new text to display in the text field. |
|
|