Mac OS X Java Swing Buttons are Disabled for no aparent reason
Question
I wrote an application in Java and when it runs on one customer's computer running OS X The Save and Export buttons are disabled. (Everything else works in the application.)
Both of these buttons open up a standard save file dialog.
Any ideas?
Solution 3
This was caused by misinformation recieved from the customer.
Turns out the customer was trying to save to a location where files can't be saved on his/her hard drive.
OTHER TIPS
The fact that these buttons open a file dialog probably has nothing to do with it being disabled. Buttons can end up being disabled for a number of reasons,
- its
setEnabled
can be called withfalse
, - when using an action, its
setEnabled
can be called withfalse
, and - when using an action, it can have a property "enabled" that potentially disables it; see Action for more information, there's a list of properties there.
Could you post how you 'implemented the JButtons'?
A stab in the dark, but most macs are still running Java 1.5; check if your current code misbehaves with Java 1.5 on your end. Maybe that's where you problem lies.