!MESSAGE Unhandled event loop exception

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

!MESSAGE Unhandled event loop exception

Postby tekcar » Sun Aug 29, 2004 2:08 pm

Error switching between code view and design views after changing some simple code.

(Note, I tried to go back to 2.0.1 and the same issue arises.

I have a consistent problem when working with a new Swing window and code in the code view. Note that in the following case, I only am working with menus. Here is the code followed by a capture from the log file. I just entered the action event for the exit menu:

I'm working with Windows XP SP1 and 1.4.2_04 Java SDK.

Thanks so much...

Tom
===================================
/*
* Created on Aug 29, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package com.briton.pps.view;

import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
* @author Tom Harrington
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class list extends JFrame {

private JMenuBar menuBar;
public static void main(String args[]) {
list frame = new list();
frame.setBounds(100, 100, 500, 350);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}

public list() {
super();
setJMenuBar(menuBar);

menuBar = new JMenuBar();

final JMenu menuFile = new JMenu();
menuBar.add(menuFile);
menuFile.setText("File");

final JMenuItem menuItemExit = new JMenuItem();
menuItemExit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
menuFile.add(menuItemExit);
menuItemExit.setText("Exit");

}
}
===================================
!ENTRY org.eclipse.ui 4 4 Aug 29, 2004 17:03:21.457
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 Aug 29, 2004 17:03:21.473
!MESSAGE No more handles
!STACK 0
org.eclipse.swt.SWTError: No more handles
at org.eclipse.swt.SWT.error(SWT.java:2717)
at org.eclipse.swt.SWT.error(SWT.java:2616)
at org.eclipse.swt.SWT.error(SWT.java:2587)
at org.eclipse.swt.graphics.Image.internal_new_GC(Image.java:1723)
at org.eclipse.swt.graphics.GC.<init>(GC.java:120)
at org.eclipse.swt.graphics.GC.<init>(GC.java:87)
at org.eclipse.draw2d.BufferedGraphicsSource.getGraphics(BufferedGraphicsSource.java:56)
at org.eclipse.draw2d.DeferredUpdateManager.getGraphics(DeferredUpdateManager.java:108)
at org.eclipse.draw2d.DeferredUpdateManager.repairDamage(DeferredUpdateManager.java:192)
at org.eclipse.draw2d.DeferredUpdateManager.performUpdate(DeferredUpdateManager.java:134)
at org.eclipse.draw2d.DeferredUpdateManager.performUpdate(DeferredUpdateManager.java:118)
at org.eclipse.draw2d.LightweightSystem.paint(LightweightSystem.java:206)
at org.eclipse.draw2d.LightweightSystem$4.handleEvent(LightweightSystem.java:110)
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.Widget.sendEvent(Widget.java:820)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:805)
at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:803)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3020)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:3338)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1467)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2429)
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.main(Main.java:628)
tekcar
 
Posts: 1
Joined: Sun Aug 29, 2004 10:55 am

Re: !MESSAGE Unhandled event loop exception

Postby Eric Clayberg » Sun Aug 29, 2004 7:25 pm

The problem is with the following two lines:

    setJMenuBar(menuBar);

    menuBar = new JMenuBar();
Reverse their order and the problem will go away. We are investigatiung why those two lines might have been generated in the wrong order.
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