JWindow in an ActionListener...

I got a JButton on a JFrame. When I click on the button, it pops a JWindow saying "Connecting...", then at the end of the actionPerformed, it disposes the JWindow. The problem is that the window does go visible at the beginning, but it only shows a gray box. It does the dispose before actually showing the "Connecting..." message. I put a sleep in between the setVisible and the dispose, and it seems it only shows up AT THE END of the actionPerformed method. Is there a way to make it show up when I invoke setVisible(true)? I tried repaint, I tried using a Thread to make it show up, nothing works.

Thanks for the help.

[635 byte] By [Poutinea] at [2007-10-3 8:33:44]
# 1
> it pops a JWindow saying "Connecting...",the rest of your actionPerformed should be in its own thread.at the end of the separate thread you call SwingUtilies.invokelater to dispose() the window
Michael_Dunna at 2007-7-15 3:41:08 > top of Java-index,Desktop,Core GUI APIs...