component overlaping when using active rendering

I’m new to this forum and want to say hello to all :slight_smile:

I’m the developer of a program called Biogenesis (http://biogenesis.sourceforge.net/). Trying to speed up the program in slow computers, I’m switching to active rendering, following the ideas in “Killer Game Programming in Java” (http://fivedots.coe.psu.ac.th/~ad/jg/). The simulation process gets faster but the problem appears when the user opens a menu: when a menu overlaps with the active rendered JPanel, it disappears due to the continuous rendering process.

My question is, how can I prevent this from happening? Is there a way to do active rendering in a windowed program and keep a menu and a tool bar without problems?

Thank you in advance for your help. Please, let me know if you need more details.

Try calling:-

JPopupMenu.setDefaultLightWeightPopupEnabled(false);

This will put the menus in separate heavyweight containers from the JPanel, which I think should clip the actively rendered graphics.

Thank you! It works perfectly. Now, the only remaining problem is with the tool bar, that is continuously rendered if it floating on the JPanel. I guess I can set its floatable property to false to avoid this, but maybe there is a way to stop it from doing that.