Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » Swing Popup Menu Problem(Cannot bring up the Popup Menu)
Swing Popup Menu Problem [message #673160] Sun, 22 May 2011 11:48 Go to next message
freetochoose is currently offline freetochoose
Messages: 19
Registered: May 2011
Junior Member
I am new to Eclipse and Windowbuilder.
Now I am trying to add a popup menu to a Jlist
and according to the documentation, it is a simple matter.
I added a JPopupmenu to the JList by dragging it.
And the list looks fine a small square at the top left corner.
and I also added a menuitem to the menu.
But when I try to preview it or when I build the project and run it.
I clicked everywhere on the JList and nothing pops up at all.
I have changed the popup size to 100x100. still nothing happens.
here is the code windowbuilder generated:

private static void addPopup(Component component, final JPopupMenu popup) {
component.addMouseListener(new MouseAdapter() {
private void showMenu(MouseEvent e) {
popup.show(e.getComponent(), e.getX(), e.getY());
}
});
}

And now I have a second problem. After I added the first popup menu. Now when I
try to add a popup menu anywhere there is an error message instead of the little
popup menu icon that i am dragging with.
the message says: Exception during live image creation. see error log for details.
here is the error log I found:

java.lang.NullPointerException
at org.eclipse.wb.internal.swing.model.component.live.SwingLiveManager.createComponentCacheEntry(SwingLiveManager.java:91)
at org.eclipse.wb.internal.core.model.util.live.AbstractLiveManager.createCacheEntryEx(AbstractLiveManager.java:108)
at org.eclipse.wb.internal.core.model.util.live.AbstractLiveManager.createCacheEntry(AbstractLiveManager.java:82)

Does anyone have any idea what's going on?

Any help is greatly appreciate.
Thanks in advance.

ftc
Re: Swing Popup Menu Problem [message #673416 is a reply to message #673160] Mon, 23 May 2011 11:04 Go to previous message
Eric Clayberg is currently offline Eric Clayberg
Messages: 856
Registered: July 2009
Location: Boston, MA
Senior Member
Please provide a complete, self-contained test case and the complete exception from your Eclispe .metadata .log file.

Alternatively, click the Generate Report button in the error window and submit a bug to Eclipse Bugzilla (Tools / WindowBuilder / Swing).
Previous Topic:Custom contextual menu for component
Next Topic:(no subject)
Goto Forum:
  


Current Time: Thu Aug 21 08:28:06 EDT 2014

Powered by FUDForum. Page generated in 0.01799 seconds