Results 1 to 1 of 1
Thread: Simplest SWT application
-
Simplest SWT application
Java Code:import org.eclipse.jface.window.ApplicationWindow; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; /** * HelloWorld is the simplest SWT application, which displays a Shell with a title. */ public class HelloWorldApplicationWindow { public static void main2(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Hello, world!"); shell.open(); while(! shell.isDisposed()) { if(! display.readAndDispatch()) {// If no more entries in event queue display.sleep(); } } display.dispose(); } public static void main(String[] args) { ApplicationWindow aw = new ApplicationWindow(null); aw.setBlockOnOpen(true); aw.open(); } }"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
Similar Threads
-
Simplest ApplicationWindow Example
By Java Tip in forum SWTReplies: 0Last Post: 07-02-2008, 08:12 PM -
Launching an application from another application dynamically
By Java Tip in forum Java TipReplies: 0Last Post: 02-16-2008, 09:31 PM -
Launching an application from another application using thread
By Java Tip in forum Java TipReplies: 0Last Post: 02-16-2008, 09:29 PM -
Help, GUI Application
By Felissa in forum AWT / SwingReplies: 2Last Post: 07-04-2007, 08:19 AM -
Simplest way to read and display a jpeg image
By Hasan in forum New To JavaReplies: 1Last Post: 05-31-2007, 03:42 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks