|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel org.apache.jorphan.gui.JLabeledTextField
public class JLabeledTextField
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JLabeledTextField()
Default constructor, The label and the Text field are left empty. |
|
JLabeledTextField(String pLabel)
Constructs a new component with the label displaying the passed text. |
|
JLabeledTextField(String pLabel,
Color bk)
|
|
JLabeledTextField(String pLabel,
int size)
|
Method Summary | |
---|---|
void |
addChangeListener(ChangeListener pChangeListener)
Adds a change listener, that will be notified when the text in the text field is changed. |
protected JTextField |
createTextField(int size)
|
void |
focusGained(FocusEvent pFocusEvent)
Catch what the value was when focus was gained. |
void |
focusLost(FocusEvent pFocusEvent)
Callback method when the focus to the Text Field component is lost. |
List<JComponent> |
getComponentList()
Get the label JLabel followed by the text field @link JTextField . |
String |
getLabel()
Returns the text of the label. |
String |
getText()
Returns the text in the Text Field. |
String |
getToolTipText()
Returns the tooltip string that has been set with setToolTipText |
protected void |
notifyChangeListeners()
Notify all registered change listeners that the text in the text field has changed. |
void |
removeChangeListener(ChangeListener pChangeListener)
Removes a change listener. |
void |
setEnabled(boolean enable)
|
void |
setLabel(String pLabel)
Set the text displayed in the label. |
void |
setText(String pText)
Set the text displayed in the Text Field. |
void |
setToolTipText(String text)
Registers the text to display in a tool tip. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JLabeledTextField()
public JLabeledTextField(String pLabel)
pLabel
- The text to in the label.public JLabeledTextField(String pLabel, int size)
public JLabeledTextField(String pLabel, Color bk)
Method Detail |
---|
public List<JComponent> getComponentList()
JLabel
followed by the text field @link JTextField
.
getComponentList
in interface JLabeledField
public void setEnabled(boolean enable)
setEnabled
in class JComponent
protected JTextField createTextField(int size)
public void focusLost(FocusEvent pFocusEvent)
focusLost
in interface FocusListener
pFocusEvent
- The focus event that occured.public void focusGained(FocusEvent pFocusEvent)
focusGained
in interface FocusListener
public void setLabel(String pLabel)
setLabel
in interface JLabeledField
pLabel
- The new label text.public void setText(String pText)
setText
in interface JLabeledField
pText
- The new text to display in the text field.public String getText()
getText
in interface JLabeledField
public String getLabel()
public void setToolTipText(String text)
setToolTipText
in class JComponent
text
- the string to display; if the text is null,
the tool tip is turned off for this componentpublic String getToolTipText()
getToolTipText
in class JComponent
public void addChangeListener(ChangeListener pChangeListener)
getText
method.
addChangeListener
in interface JLabeledField
pChangeListener
- The listener to addpublic void removeChangeListener(ChangeListener pChangeListener)
pChangeListener
- The change listener to remove.protected void notifyChangeListeners()
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |