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

JOptionPane

1 view
Skip to first unread message

Ying Huang

unread,
May 22, 1998, 3:00:00 AM5/22/98
to

Dear Sir/Madam:

When I use JOptionPane.showMessageDialog (see code below)and press
"OK" button, I got
Exception occurred during event dispatching:
java.lang.NullPointerException
at java.awt.LightweightDispatcher.retargetMouseEvent(Compiled
Code)
at java.awt.LightweightDispatcher.processMouseEvent(Compiled
Code)
at java.awt.LightweightDispatcher.dispatchEvent(Compiled Code)
at java.awt.Container.dispatchEventImpl(Compiled Code)
at java.awt.Window.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:63)

Also where can I find the source code for LightweightDispatcher?


Enviroment:

HP-UX 10.20 A 9000/887

java version "HP-UX Java B.01.12.01 1997/07/31" (HP JDK 1.13)

Code:
try {
....
} catch (MySqlException e) {
System.out.println(e.getMessage());
JOptionPane.showMessageDialog(null,
e.getMessage(),"Error",
JOptionPane.ERROR_MESSAGE);
}

Thanks,

Ying Huang

Patrick Wray

unread,
May 23, 1998, 3:00:00 AM5/23/98
to

Ying Huang wrote in message <6k514b$i...@anchor.cis.att.com>...


Perhaps it's the first parameter you're passing to showMessageDialog?
Try passing it a reference to your application's frame instead.
Eg.

JOptionPane.showMessageDialog(MyApp.frame, "Message text");

This is guesswork, but worth a try.


0 new messages