How do I show and hide a popup message by the program

Hi,

I've the following problem. Sometime the program must wait to open a seriel port. On slow machines, this could take some seconds.

During this time I'll display a popup message with the message "please, be patient....".

After the port is open, the message should be hide by the program.

JOptionPane could be good, but without a "OK" button. Everthing should be controlled by the program.

I would implement the Runnable interface for the showing of the popup message.

Any ideas? Thanks in advance.

Hans

[555 byte] By [Hans-Joachima] at [2007-11-27 4:51:38]
# 1
[url http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html]How to Use Progress Bars[/url]. You would want to use an indeterminate progress bar.
camickra at 2007-7-12 10:05:25 > top of Java-index,Desktop,Core GUI APIs...
# 2

You can use a JDialog... this will act like JOptionPane, but you can put on it whatever components you like... so no OK button!

For example:

JDialog dialog = new JDialog(parentFrame);

dialog.add(new JLabel("Please be patient", BorderLayout.CENTER);

dialog.pack();

dialog.setLocation(100,100);

dialog.setVisible(true);

...

dialog.setVisible(false);

clairec666a at 2007-7-12 10:05:25 > top of Java-index,Desktop,Core GUI APIs...