Question

My application uses some implementation of licensing mechanics. Depending of license type some menu items must be invisible. And now I've run into problem on Mac OS X 10.6.2. Java version 1.6.0_15. Menu items just won't disapear no matter what. I debugged method which implements that functionality and saw with my own eyes - attribute visible becomes false! And there's no code wich could change that in this application. Even more - app works fine on all Windows-es i have with last JRE and on OS X updated to 10.6.8 with Java 1.6.0_31. Is this a buggy Apple's JVM? What is the best solution in such case?

Was it helpful?

Solution

Well, I tried to create SSCCE and failed. In simple subclass of JFrame all works fine. Items disapear as intended. But instead i've found this document. And it says:

Radar #7420583
JMenuItems setVisible(false) do not hide.
Description:
The screen menu bar would not hide JMenuItems that were marked setVisible(false).
Resolution: This issue has been resolved.

As I expected it's Apple's fault. What's left for me is to explicitly check for runtime version on Mac OS X. Any other solutions are welcome in comments(except of upgrading java - it's not my area of responsibility).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top