| java.lang.Object thinwire.ui.AbstractComponent thinwire.ui.AbstractTextComponent thinwire.ui.Label
Label | public class Label extends AbstractTextComponent implements AlignTextComponent(Code) | | A Label is the text that appears next to a control on a
screen.
Example:
Dialog dlg = new Dialog("Label Test");
dlg.setBounds(25, 25, 415, 150);
final Label lbl = new Label("Initial 1st Label");
lbl.setBounds(25, 25, 150, 30);
Button btn = new Button("Toggle Text");
btn.setBounds(300, 20, 100, 30);
btn.addActionListener(Button.ACTION_CLICK, new ActionListener() {
public void actionPerformed(ActionEvent ev) {
if ("Initial 1st Label".equals(lbl.getText())) {
lbl.setText("The text has now been toggled.");
} else {
lbl.setText("Initial 1st Label");
}
}
});
dlg.getChildren().add(lbl);
dlg.getChildren().add(btn);
dlg.setVisible(true);
Keyboard Navigation:
author: Joshua J. Gertzen |
Constructor Summary | |
public | Label() Constructs a new Label with no text. | public | Label(String text) Constructs a new Label with the specified text. |
PROPERTY_LABEL_FOR | final public static String PROPERTY_LABEL_FOR(Code) | | |
PROPERTY_WRAP_TEXT | final public static String PROPERTY_WRAP_TEXT(Code) | | |
Label | public Label()(Code) | | Constructs a new Label with no text.
|
Label | public Label(String text)(Code) | | Constructs a new Label with the specified text.
Parameters: text - the text to display on the Label. |
getAlignX | public AlignX getAlignX()(Code) | | |
getLabelFor | public Component getLabelFor()(Code) | | Returns the component that this label is associated with.
the Component associated with this Label. |
isWrapText | public boolean isWrapText()(Code) | | |
setAlignX | public void setAlignX(AlignX alignX)(Code) | | |
setLabelFor | public void setLabelFor(Component labelFor)(Code) | | This method links a label with an onscreen component.
Parameters: labelFor - the component to link with the label |
setWrapText | public void setWrapText(boolean wrapText)(Code) | | |
Methods inherited from thinwire.ui.AbstractComponent | public void addActionListener(String action, ActionListener listener)(Code)(Java Doc) public void addActionListener(String[] actions, ActionListener listener)(Code)(Java Doc) public void addDropListener(Component dragComponent, DropListener listener)(Code)(Java Doc) public void addDropListener(Component[] dragComponents, DropListener listener)(Code)(Java Doc) public void addKeyPressListener(String keyPressCombo, KeyPressListener listener)(Code)(Java Doc) public void addKeyPressListener(String[] keyPressCombos, KeyPressListener listener)(Code)(Java Doc) public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public void addPropertyChangeListener(String[] propertyNames, PropertyChangeListener listener)(Code)(Java Doc) public void fireAction(ActionEvent ev)(Code)(Java Doc) public void fireAction(String action)(Code)(Java Doc) public void fireAction(String action, Object source)(Code)(Java Doc) public void fireDrop(DropEvent ev)(Code)(Java Doc) public void fireDrop(Component dragComponent)(Code)(Java Doc) public void fireDrop(Component dragComponent, Object dragObject)(Code)(Java Doc) public void fireKeyPress(KeyPressEvent ev)(Code)(Java Doc) public void fireKeyPress(String keyPressCombo)(Code)(Java Doc) final protected boolean firePropertyChange(Object source, String propertyName, int oldValue, int newValue)(Code)(Java Doc) final protected boolean firePropertyChange(Object source, String propertyName, boolean oldValue, boolean newValue)(Code)(Java Doc) final protected boolean firePropertyChange(Object source, String propertyName, Object oldValue, Object newValue)(Code)(Java Doc) public Container getContainer()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public Label getLabel()(Code)(Java Doc) public Object getLimit()(Code)(Java Doc) public Object getParent()(Code)(Java Doc) String getStandardPropertyUnsupportedMsg(String propertyName, boolean read)(Code)(Java Doc) public Style getStyle()(Code)(Java Doc) public Object getUserObject()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public int getX()(Code)(Java Doc) public int getY()(Code)(Java Doc) public boolean isEnabled()(Code)(Java Doc) final public boolean isFocus()(Code)(Java Doc) public boolean isFocusCapable()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) public void removeActionListener(ActionListener listener)(Code)(Java Doc) public void removeDropListener(DropListener listener)(Code)(Java Doc) public void removeKeyPressListener(KeyPressListener listener)(Code)(Java Doc) public void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public Component setBounds(int x, int y, int width, int height)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setFocus(boolean focus)(Code)(Java Doc) public void setFocusCapable(boolean focusCapable)(Code)(Java Doc) public void setHeight(int height)(Code)(Java Doc) void setLabel(Label label)(Code)(Java Doc) public Component setLimit(Object limit)(Code)(Java Doc) void setParent(Object parent)(Code)(Java Doc) public Component setPosition(int x, int y)(Code)(Java Doc) void setRenderer(Renderer r)(Code)(Java Doc) public Component setSize(int width, int height)(Code)(Java Doc) public void setUserObject(Object userObject)(Code)(Java Doc) public void setVisible(boolean visible)(Code)(Java Doc) public void setWidth(int width)(Code)(Java Doc) public void setX(int x)(Code)(Java Doc) public void setY(int y)(Code)(Java Doc)
|
|
|