Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » SWT error opening a dialog
SWT error opening a dialog [message #206863] Sun, 08 January 2006 08:59
Eclipse UserFriend
Originally posted by: marguu.libero.it

Opening a dialog in order to let the user insert his own values for an
element, I obtain this error:
org.eclipse.swt.SWTException: Failed to execute runnable
(java.lang.NullPointerException)
at org.eclipse.swt.SWT.error(SWT.java:2942)
at org.eclipse.swt.SWT.error(SWT.java:2865)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:126)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
at
genericUMLDiagramEditor.dialogs.ContainerPropertiesInputDial og.open(ContainerPropertiesInputDialog.java:125)
I use this code in the open method:
public String open() {
// Create the dialog window
Shell shell = new Shell(getParent(), getStyle());
shell.setText(getText());
createContents(shell);
shell.setSize(400,370);
shell.setLocation(200,200);
shell.open();
Display display = getParent().getDisplay();

while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
// Return the entered value, or null
return input1;
}
I don't understand where is the problem; I use this structure in other
classes in my project and all work fine. Thanks
Previous Topic:Background image
Next Topic:about omondo eclipseuml
Goto Forum:
  


Current Time: Wed Apr 24 19:46:11 GMT 2024

Powered by FUDForum. Page generated in 0.02090 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top