Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Popup menu parent ( null pointer exception )

16 views
Skip to first unread message

Ilougino Rocha

unread,
Sep 14, 1998, 3:00:00 AM9/14/98
to
Can anyone tell me why does the following code cause and exception?

PopupMenu p = new PopupMenu();
p.add("test1");
System.out.println("I got here");
p.show( SchedulerTree, event.getX(), event.getY() );

The Exception is:
Exception occurred during event dispatching:
java.lang.NullPointerException: parent is null
at java.awt.PopupMenu.show(PopupMenu.java:90)
at Frame1.SchedulerTree_mouseClicked(Frame1.java:595)
at Frame1$SymMouse.mouseClicked(Frame1.java:581)
at
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:215)
at java.awt.Component.processMouseEvent(Component.java:2287)
at java.awt.Component.processEvent(Component.java:2129)
at java.awt.Container.processEvent(Container.java:894)
at java.awt.Component.dispatchEventImpl(Component.java:1764)
at java.awt.Container.dispatchEventImpl(Container.java:939)
at java.awt.Component.dispatchEvent(Component.java:1704)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:63)

It claims that the parent is null, but I don't even see how to set the
parent.
Thanks in advance Ilougino Rocha.

0 new messages