0

I'm working on a GUI that uses Java3D to display previews of 3d models. I have a JTabbedPane wherein each tab is a Canvas3D to allow loading multiple previews and switching between them. This has been working fine until I got around to adding in the functionality to remove tabs. When a tab is removed, most of the time, the remaining tabs stop rendering the 3d models while rarely they will continue working as intended. There is no apparent set of conditions that can determine when the tabs will continue working and when they won't. Loading up a new preview, however, will bring all other tabs right back to life.

Things I've tried:

  • Calling validate on the JTabbedPane
  • Calling invalidate on the JTabbedPane and then validate
  • Calling invalidate/validate on the new currently selected Canvas3D tab
  • Calling repaint() on Canvas3D, JTabbedPane, etc.
  • Calling stopView() startView() on the View object attached to the Canvas3D

Calling isViewRunning() returns true even when it appears it isn't so maybe I'm looking in the completely wrong place for this problem. Any thoughts on this would be very much appreciated.

4

1 回答 1

1

在 6u33 或 7u5 (Win 7 64) 上运行我的应用程序时,Canvas3D 选项卡正确呈现。在“以前”,根据解决方法提示,当删除选项卡时,我在 JTabbedPane 的 ChangeListener 中调用了顶级组件(通常是 JFrame)上的验证。

于 2012-07-05T06:47:08.573 回答