Example usage for Java org.eclipse.swt.widgets Label fields, constructors, methods, implement or subclass
The text is from its open source code.
Label(Composite parent, int style) Constructs a new instance of this class given its parent and a style value describing its behavior and appearance. |
void | addDisposeListener(DisposeListener listener) Adds the listener to the collection of listeners who will be notified when the widget is disposed. |
void | addListener(int eventType, Listener listener) Adds the listener to the collection of listeners who will be notified when an event of the given type occurs. |
void | addMouseListener(MouseListener listener) Adds the listener to the collection of listeners who will be notified when mouse buttons are pressed and released, by sending it one of the messages defined in the MouseListener interface. |
Point | computeSize(int wHint, int hHint) Returns the preferred size of the receiver. |
Accessible | getAccessible() Returns the accessible object for the receiver. |
Color | getBackground() Returns the receiver's background color. |
Rectangle | getBounds() Returns a rectangle describing the receiver's size and location relative to its parent (or its display if its parent is null), unless the receiver is a shell. |
Object | getData(String key) Returns the application defined property of the receiver with the specified name, or null if it has not been set. |
Display | getDisplay() Returns the Display that is associated with the receiver. |
Font | getFont() Returns the font that the receiver will use to paint textual information. |
Image | getImage() Returns the receiver's image if it has one, or null if it does not. |
Composite | getParent() Returns the receiver's parent, which must be a Composite or null when the receiver is a shell that was created with null or a display for a parent. |
Shell | getShell() Returns the receiver's shell. |
Point | getSize() Returns a point describing the receiver's size. |
int | getStyle() Returns the receiver's style information. |
String | getText() Returns the receiver's text, which will be an empty string if it has never been set or if the receiver is a SEPARATOR label. |
boolean | isDisposed() Returns true if the widget has been disposed, and false otherwise. |
void | pack() Causes the receiver to be resized to its preferred size. |
void | redraw() Causes the entire bounds of the receiver to be marked as needing to be redrawn. |
void | requestLayout() Requests that this control and all of its ancestors be repositioned their layouts at the earliest opportunity. |
void | setAlignment(int alignment) Controls how text and images will be displayed in the receiver. |
void | setBackground(Color color) Sets the receiver's background color to the color specified by the argument, or to the default system color for the control if the argument is null. |
void | setBounds(Rectangle bounds) Sets the receiver's size and location to the rectangular area specified by the argument. |
void | setBounds(int x, int y, int width, int height) Sets the receiver's size and location to the rectangular area specified by the arguments. |
void | setData(String key, Object value) |
void | setFont(Font font) Sets the font that the receiver will use to paint textual information to the font specified by the argument, or to the default font for that kind of control if the argument is null. |
void | setForeground(Color color) Sets the receiver's foreground color to the color specified by the argument, or to the default system color for the control if the argument is null. |
void | setImage(Image image) Sets the receiver's image to the argument, which may be null indicating that no image should be displayed. |
void | setLayoutData(Object layoutData) Sets the layout data associated with the receiver to the argument. |
void | setLocation(int x, int y) Sets the receiver's location to the point specified by the arguments which are relative to the receiver's parent (or its display if its parent is null), unless the receiver is a shell. |
void | setMenu(Menu menu) Sets the receiver's pop up menu to the argument. |
void | setText(String text) Sets the receiver's text. |
void | setToolTipText(String toolTipText) Sets the receiver's tool tip text to the argument, which may be null indicating that no tool tip text should be shown. |
void | setVisible(boolean visible) Marks the receiver as visible if the argument is true , and marks it invisible otherwise. |
void | update() Forces all outstanding paint requests for the widget to be processed before this method returns. |