Results 1 to 1 of 1
Thread: Demonstration of Buttons
-
Demonstration of Buttons
Java Code:import org.eclipse.swt.SWT; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; /** * This class demonstrates Buttons */ public class ButtonExample { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(3, true)); // Create three push buttons new Button(shell, SWT.PUSH).setText("Push 1"); new Button(shell, SWT.PUSH).setText("Push 2"); new Button(shell, SWT.PUSH).setText("Push 3"); // Create three checkboxes new Button(shell, SWT.CHECK).setText("Checkbox 1"); new Button(shell, SWT.CHECK).setText("Checkbox 2"); new Button(shell, SWT.CHECK).setText("Checkbox 3"); // Create three toggle buttons new Button(shell, SWT.TOGGLE).setText("Toggle 1"); new Button(shell, SWT.TOGGLE).setText("Toggle 2"); new Button(shell, SWT.TOGGLE).setText("Toggle 3"); // Create three radio buttons new Button(shell, SWT.RADIO).setText("Radio 1"); new Button(shell, SWT.RADIO).setText("Radio 2"); new Button(shell, SWT.RADIO).setText("Radio 3"); // Create three flat buttons new Button(shell, SWT.FLAT).setText("Flat 1"); new Button(shell, SWT.FLAT).setText("Flat 2"); new Button(shell, SWT.FLAT).setText("Flat 3"); // Create three arrow buttons new Button(shell, SWT.ARROW); new Button(shell, SWT.ARROW | SWT.LEFT); new Button(shell, SWT.ARROW | SWT.DOWN); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } }"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
Similar Threads
-
GUI buttons question...
By glenrowan in forum New To JavaReplies: 3Last Post: 01-18-2011, 05:23 PM -
How to use SWT Buttons
By Java Tip in forum SWTReplies: 0Last Post: 07-11-2008, 04:44 PM -
Demonstration of various Swing buttons
By Java Tip in forum javax.swingReplies: 0Last Post: 06-26-2008, 07:37 PM -
Next and Previous Buttons
By JavaNewb in forum New To JavaReplies: 1Last Post: 05-09-2008, 01:23 AM -
Next, Finish Buttons !!!
By pele in forum SWT / JFaceReplies: 1Last Post: 07-14-2007, 05:22 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks