Results 1 to 1 of 1
Thread: SWT push button
-
SWT push button
The code snippet below shows how to create SWT push buttons.
Java Code:import org.eclipse.swt.SWT; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; public class PushButtonExample { 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"); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } }
Similar Threads
-
Stack push/pop/peek operations
By Java Tip in forum Java TipReplies: 0Last Post: 01-29-2008, 09:03 AM -
Using SWT Button
By Java Tip in forum Java TipReplies: 0Last Post: 01-08-2008, 09:05 AM -
applet button
By kazitula in forum Java AppletsReplies: 2Last Post: 11-14-2007, 07:25 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks