Create JFrame or Swing Component problem

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Create JFrame or Swing Component problem

Postby BlackBug » Mon Feb 07, 2005 6:46 pm

When i create a new JFrame or Swing component and switch it to Design mode, then the eclipse will show the error Message "java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread". So what is the problem to make this error?

Thanks!

This is the Error log of Eclipse:
===============================================
!ENTRY com.swtdesigner 4 4 2月 08, 2005 09:28:05.115
!MESSAGE Designer internal error: java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
!STACK 0
com.swtdesigner.properties.PropertyException: java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
at com.swtdesigner.model.swing.component.ComponentBeanInfo.createShot(ComponentBeanInfo.java:776)
at com.swtdesigner.model.swing.component.ContainerBeanInfo.createShot(ContainerBeanInfo.java:491)
at com.swtdesigner.model.JavaInfo.notifyPropertyChanged(JavaInfo.java:5471)
at com.swtdesigner.model.JavaInfo.notifyPropertyChanged(JavaInfo.java:5453)
at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite.handleRootNodeSelected(DesignerEditorPropertyComposite.java:492)
at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite.updatePropertyComposite(DesignerEditorPropertyComposite.java:644)
at com.swtdesigner.gef.DesignerEditor.parseCompilationUnit(DesignerEditor.java:828)
at com.swtdesigner.gef.DesignerEditor.handleActivate(DesignerEditor.java:731)
at com.swtdesigner.gef.DesignerEditor.handleActivate(DesignerEditor.java:699)
at com.swtdesigner.editors.MultiPageEditor.showDesignEditor(MultiPageEditor.java:289)
at com.swtdesigner.editors.MultiPageEditor.switchSourceDesign(MultiPageEditor.java:329)
at com.swtdesigner.actions.editor.SwitchAction.run(SwitchAction.java:12)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:276)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:915)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:866)
at org.eclipse.jface.action.ActionContributionItem$8.handleEvent(ActionContributionItem.java:824)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2772)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2431)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.basicRun(Main.java:183)
at org.eclipse.core.launcher.Main.run(Main.java:644)
at org.eclipse.core.launcher.Main.eclipse_main(Main.java:628)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.m7.installer.util.NitroxMain$1.run(NitroxMain.java:28)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
at java.awt.EventQueue.invokeAndWait(Unknown Source)
at com.swtdesigner.test.TestSwingShot.createShot(TestSwingShot.java:154)
at com.swtdesigner.test.TestSwingShot.createShotWindow(TestSwingShot.java:194)
at com.swtdesigner.model.swing.component.ComponentBeanInfo.createShot(ComponentBeanInfo.java:765)
... 46 more
===============================================
BlackBug
 

Re: Create JFrame or Swing Component problem

Postby Eric Clayberg » Mon Feb 21, 2005 9:48 am

BlackBug wrote:When i create a new JFrame or Swing component and switch it to Design mode, then the eclipse will show the error Message "java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread". So what is the problem to make this error?

Try this with the latest v3.0.1 build.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: Google [Bot] and 1 guest