Mark
Mark

Reputation: 3

PopupMenu freezing parent frame

I'm using a AWT PopupMenu on a frame that constantly repaints (it's a game), but whenever the PopupMenu shows, the parent frame freezes. Is there a way to disable this?

Upvotes: 0

Views: 331

Answers (1)

Jasper Siepkes
Jasper Siepkes

Reputation: 1405

I assume the rest of the application is in made in Swing and you are using the AWT popmenu in combination with Swing components.

I've had my fair share of AWT PopMenu problems. Do you need to show the Popmenu outside the bounds of your application ? If you only need to be able to show it inside your application (JFrame) you are probably beter off with just putting a JComponent on top of all your other panels (with a JLayredPane) and draw your own pop menu there.

Even easier is to use JLayer in Java 7 for the same effect (or JXLayer if your not on Java 7 but on Java 5 or 6).

The above method is also way more powerful then the AWT popmenu because you control the drawing. So for example making it translucent or giving it round edges becomes a breeze.

Upvotes: 1

Related Questions