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?
Asked
Active
Viewed 166 times
0
-
For better help sooner, post an [SSCCE](http://sscce.org/). – Andrew Thompson May 25 '12 at 09:25
-
1@AndrewThompson: i rely on someone who experienced similar problem before. I don't sure, i could reproduce problem myself. I'll try though. – Aleksandr Kravets May 25 '12 at 09:41
-
*"I'll try though."* +1. It should not take more than about 40 lines of SSCCE to reproduce. BTW - why not add actions to the menu items and disable the action? That will result in the menu item looking 'disabled' rather than 'disappearing' - but than that would most likely be the path of least surprise for the user in any case. – Andrew Thompson May 25 '12 at 09:46
-
@AndrewThompson: There are some options about which user don't need to know. Foolproof, kind of. – Aleksandr Kravets May 25 '12 at 10:02
1 Answers
0
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).

Aleksandr Kravets
- 5,750
- 7
- 53
- 72
-
But that says it's resolved, which implies that it's no longer Apple's fault. – Tharwen May 25 '12 at 15:33
-
@Tharwen: it's true, but i can't be sure potential user has proper version of JVM. I don't want to make explicit version check, but can't afford to leave things like this. Maybe you can propose a workaround? – Aleksandr Kravets May 26 '12 at 13:15
-
Oh, I see what you mean. Well... I don't think there's much you can do about that... – Tharwen May 26 '12 at 14:28
-