JMenuBar dropping down to a "custom" JPanel and "erased"
Posted
by Jani
on Stack Overflow
See other posts from Stack Overflow
or by Jani
Published on 2010-03-24T14:08:13Z
Indexed on
2010/03/24
15:13 UTC
Read the original article
Hit count: 491
The JMenuItems of JMenuBar drops down to a JPanel added to the JFrame, but the JPanel erases the JMenuItems.
Do I supposed to pause the re-drawing of the JPanel?
I'm using getGraphics() on the JPanel for drawing an image, this method is called from a thread with (for example) 200 ms delay.
edit:
It's a (very simple) game inside the JPanel.
(I've added a field "paused" to the JPanel and i've edited the paint method so it repaints the JPanel only if paused is false, however I don't know if this "solution" is good. (It's set to true when the user clicks on a menu and set to false when selects or cancels it.)
© Stack Overflow or respective owner