aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JWindow showing up as a white box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JWindow showing up as a white box" Watch "JWindow showing up as a white box" New topic
Author

JWindow showing up as a white box

Atrus Greyor
Ranch Hand

Joined: Mar 07, 2004
Posts: 110
I have the code for a nice JWindow as follows



Now all of this works when I run it by itself like as follows



However when it is brought up along with my GUI and another JWindow it just shows up as a white box.

Any ideas as to why it does this?
dave taubler
Ranch Hand

Joined: May 15, 2001
Posts: 132
This part:



and the fact that you call it in the askForPos() method is probably the cause of the problem. Basically, you're blocking the Event Dispatch thread, thus preventing the Window from repainting (or in your cause, painting for the first time). Even if it did paint successfully, it wouldn't be able to process any user input.

Better would be to not block at all, but to instead move the code that eventually disposes the Window (I assume you also want to setVisible(false) on it as well) to the actionPerformed() event handling code.


Dave Taubler<br />Specializing in <a href="http://taubler.com/articles/" target="_blank" rel="nofollow">Java and Web Development</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JWindow showing up as a white box