🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
1 messages
1 total messages Started by Uwe Clement Mon, 29 Mar 2004 10:09
JCombobox in JPopupMenu (NullPointerException)
#1107
Author: Uwe Clement
Date: Mon, 29 Mar 2004 10:09
88 lines
3924 bytes
HI there,

i want to display a jcombobox withhin a jpopupmenu.

----------------------------------------------------------------------------
--
JPopupMenu menu = new JPopupMenu();
JComboBox box = new JComboBox();
...
menu.add(box);
menu.show(frame, 0,0);
----------------------------------------------------------------------------
---

after opening the popupmenu of the combobox i will get a
nullpointerexception.

is there no way to display two popupmenues at the same time ?
see the exception log below.

many thanks i advance !

uwe clement



===================================================================
java.lang.NullPointerException
        at
javax.swing.plaf.basic.BasicPopupMenuUI$MouseGrabber.grabContainer(Ba
sicPopupMenuUI.java:344)
        at
javax.swing.plaf.basic.BasicPopupMenuUI$MouseGrabber.requestAddGrab(B
asicPopupMenuUI.java:227)
        at
javax.swing.plaf.basic.BasicPopupMenuUI$MouseGrabber.stateChanged(Bas
icPopupMenuUI.java:273)
        at
javax.swing.MenuSelectionManager.fireStateChanged(MenuSelectionManage
r.java:158)
        at
javax.swing.MenuSelectionManager.setSelectedPath(MenuSelectionManager
.java:86)
        at javax.swing.JPopupMenu.setVisible(JPopupMenu.java:741)
        at javax.swing.JPopupMenu.show(JPopupMenu.java:912)
        at
javax.swing.plaf.basic.BasicComboPopup.show(BasicComboPopup.java:177)

        at
javax.swing.plaf.basic.BasicComboPopup.togglePopup(BasicComboPopup.ja
va:982)
        at
javax.swing.plaf.basic.BasicComboPopup$InvocationMouseHandler.mousePr
essed(BasicComboPopup.java:632)
        at
java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:21
8)
        at java.awt.Component.processMouseEvent(Component.java:5090)
        at java.awt.Component.processEvent(Component.java:4890)
        at java.awt.Container.processEvent(Container.java:1566)
        at java.awt.Component.dispatchEventImpl(Component.java:3598)
        at java.awt.Container.dispatchEventImpl(Container.java:1623)
        at java.awt.Component.dispatchEvent(Component.java:3439)
        at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450
)
        at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3162)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
        at java.awt.Container.dispatchEventImpl(Container.java:1609)
        at java.awt.Window.dispatchEventImpl(Window.java:1585)
        at java.awt.Component.dispatchEvent(Component.java:3439)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:197)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:150)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)

        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
===================================================================
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads