Java3D stutter issues with Swing tooltips

In the Java project I'm working on, there is a strange conflict between the Java3d and Swing hints.

Our program is configured using Java3D Canvas3D in a center surrounded by Swing JComponents (buttons, sliders, text fields, etc.). The keyboard and mouse are used to navigate the 3D world, and the buttons allow you to perform other manipulations.

The problem is that whenever the prompt from the Swing components goes beyond our window (JFrame), the movement in Java3D slows down to a crawl and has serious problems with stuttering. Due to all the problems we read about heavy / light mixing in a swing, we suggested that this could be a problem.

Our initial solution was to override each getToolTipLocation () method to ensure that tooltips remain inside our window. This seemed to work mostly, but it left tooltips in odd places. In addition, we sometimes get a stutter / slowdown problem as soon as the program starts and before the tooltips are created (every 20-30 starts).

Then yesterday I discovered an even stranger way to fix it. As long as the tool tips have a width of 151 pixels or more, they do not cause problems with deceleration outside the window. Any tooltip that is 150 pixels wide or less causes a slowdown / stutter problem as soon as it leaves the window. By overriding createToolTip () in each type of component that we use, we can call setPreferedSize () and make sure that all tooltips for the tool are 151 pixels wide. The problems with this workaround, of course, are that all tooltips have either many spaces or are truncated.

Does anyone know what might cause this strange behavior and what can I try to fix?

+4
source share
1 answer

To solve problems with heavy weight / ease of mixing, I always choose the following settings regarding JPopupMenu and ToolTip:

import javax.swing.JPopupMenu; import javax.swing.ToolTipManager; ToolTipManager ttManager = ToolTipManager.sharedInstance(); ttManager.setEnabled(true); ttManager.setLightWeightPopupEnabled(false); JPopupMenu.setDefaultLightWeightPopupEnabled(false); 

Did you do it too? Or does it help?

August, InteractiveMesh

0
source

All Articles