Xah's Edu Corner: Criticism vs Constructive Criticism

J

James McGill

I have a problem getting this to work. It's in the update() method of an observer, and I want to
see this JOptionPane every update:

JOptionPane.showMessageDialog(null, result.toString(), "Result", JOptionPane.INFORMATION_MESSAGE);

It shows fine the first time, but after the first time, I just see the JOptionPane's frame, and it will
paint the button if I mouse over it, but no message. What could be wrong? the "result" object isn't null
or anything like that.

Makes no difference if I put a container as the first argument.
 
T

Trung Chinh Nguyen

James said:
I have a problem getting this to work. It's in the update() method of an observer, and I want to
see this JOptionPane every update:

JOptionPane.showMessageDialog(null, result.toString(), "Result", JOptionPane.INFORMATION_MESSAGE);

It shows fine the first time, but after the first time, I just see the JOptionPane's frame, and it will
paint the button if I mouse over it, but no message. What could be wrong? the "result" object isn't null
or anything like that.

Makes no difference if I put a container as the first argument.

There's nothing wrong with that piece of code. The bug might lie
somewhere else so it might be useful if you can give some more details
 
A

antroy

24. Learn when not to reply to a troll (and bother several groups while
doing so).

25. Learn when not to reply to a reply to a troll (and bother several
groups while doing so).

This could go on and on... ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top