Example usage for Java org.eclipse.swt.widgets Button fields, constructors, methods, implement or subclass
The text is from its open source code.
Button(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 | addFocusListener(FocusListener listener) Adds the listener to the collection of listeners who will be notified when the control gains or loses focus, by sending it one of the messages defined in the FocusListener interface. |
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. |
void | addSelectionListener(SelectionListener listener) Adds the listener to the collection of listeners who will be notified when the control is selected, by sending it one of the messages defined in the SelectionListener interface. |
void | addTraverseListener(TraverseListener listener) Adds the listener to the collection of listeners who will be notified when traversal events occur, by sending it one of the messages defined in the TraverseListener interface. |
Point | computeSize(int wHint, int hHint) Returns the preferred size of the receiver. |
void | dispose() Disposes of the operating system resources associated with the receiver and all its descendents. |
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() Returns the application defined widget data associated with the receiver, or null if it has not been set. |
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. |
boolean | getEnabled() Returns true if the receiver is enabled, and false otherwise. |
boolean | getGrayed() Returns true if the receiver is grayed, and false otherwise. |
Image | getImage() Returns the receiver's image if it has one, or null if it does not. |
Object | getLayoutData() Returns layout data which is associated with the receiver. |
Point | getLocation() Returns a point describing the receiver's location relative to its parent (or its display if its parent is null), unless the receiver is a shell. |
Monitor | getMonitor() Returns the receiver's monitor. |
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. |
boolean | getSelection() Returns true if the receiver is selected, and false otherwise. |
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. |
void | moveAbove(Control control) Moves the receiver above the specified control in the drawing order. |
void | pack() Causes the receiver to be resized to its preferred size. |
void | setAlignment(int alignment) Controls how text, images and arrows 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(int x, int y, int width, int height) Sets the receiver's size and location to the rectangular area specified by the arguments. |
void | setBounds(Rectangle bounds) Sets the receiver's size and location to the rectangular area specified by the argument. |
void | setCursor(Cursor cursor) Sets the receiver's cursor to the cursor specified by the argument, or to the default cursor for that kind of control if the argument is null. |
void | setData(Object data) Sets the application defined widget data associated with the receiver to be the argument. |
void | setData(String key, Object value) |
void | setEnabled(boolean enabled) Enables the receiver if the argument is true , and disables it otherwise. |
boolean | setFocus() Causes the receiver to have the keyboard focus, such that all keyboard events will be delivered to it. |
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 | setGrayed(boolean grayed) Sets the grayed state of the receiver. |
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 | setLocation(Point location) 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 | setOrientation(int orientation) Sets the orientation of the receiver, which must be one of the constants SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT . |
void | setSelection(boolean selected) Sets the selection state of the receiver, if it is of type CHECK , RADIO , or TOGGLE . |
void | setSize(int width, int height) Sets the receiver's size to the point specified by the arguments. |
void | setSize(Point size) Sets the receiver's size to the point specified by 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. |
Point | toControl(int x, int y) Returns a point which is the result of converting the argument, which is specified in display relative coordinates, to coordinates relative to the receiver. |
Point | toDisplay(int x, int y) Returns a point which is the result of converting the argument, which is specified in coordinates relative to the receiver, to display relative coordinates. |