Forums Register Login

JWindow showing up as a white box

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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.
They worship nothing. They say it's because nothing lasts forever. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1356 times.
Similar Threads
KeyListener not working for JLabel.
GUI almost there. Please help!
JButtons fail to change
setting of Border on JFrame or JWindow ..: Confusion on Ghraphic
Tally will not add up
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 05:18:03.