Wednesday, February 08, 2006

VTK and JMenu

Whenever you tried to have Menus and VTK in your Java program the menus pop up but disappear behind the VTK widget. The same is true for JTabbedPane, JComboBox, and the like. The root of the problem is the incompatibilty of Lightweight and Heavyweight components. To solve it in my case at least -- write before you instantiate any component:

JPopupMenu.setDefaultLightWeightPopupEnabled( false );

This will make the menus behave like heaviweight components and everything will be good.

1 Comments:

Anonymous Cameron said...

Fantastic! This will really help our viewer work a lot more like a real desktop app...

2:48 PM

 

Post a Comment

<< Home