Results 1 to 1 of 1
Thread: Example of SWT Dialog
-
Example of SWT Dialog
An example of SWTDialog is presented below:
Java Code:public class SWTDialog extends Dialog { Object result; public SWTDialog (Shell parent, int style) { super (parent, style); } public SWTDialog (Shell parent) { this (parent, 0); // your default style bits go here (not the Shell's style bits) } public Object open () { Shell parent = getParent(); Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); shell.setText(getText()); // Your code goes here (widget creation, set result, etc). shell.open(); Display display = parent.getDisplay(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } return result; } }
Similar Threads
-
Run As dialog and Plugin Help
By menelaosbgr in forum EclipseReplies: 0Last Post: 03-25-2008, 03:21 AM -
Example - File Dialog
By Java Tip in forum Java TipReplies: 0Last Post: 03-01-2008, 10:11 PM -
My Preference Dialog
By schuetzejanett in forum EclipseReplies: 3Last Post: 08-10-2007, 10:48 AM -
Dialog Box
By uncopywritable in forum New To JavaReplies: 2Last Post: 07-30-2007, 12:42 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks