<Swing Dev> [11] RFR JDK-8191106: Nimbus LookAndFeel does not apply keys FileChooser.directoryOpenButtonText/ToolTipText to JFileChooser

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Thu Jan 4 10:33:52 UTC 2018


Hi All,

Please review a fix for Nimbus L&F where it is seen that
When you select a directory in a JFileChooser dialog, the text and 
tooltip of the "approve" button is not changing to the values of 
UIManager keys FileChooser.directoryOpenButtonText and 
FileChooser.directoryOpenButtonToolTipText and remain same as it was 
before directory is selected.
It changes for Metal and windows l&f.

This is because when directory is selected 
BasicFileChooserUI#valueChanged() calls setDirectorySelected() but it's 
not implemented for nimbus l&f and it uses default implementation of 
BasicFileChooser.
For Metal & Windows, this method is overridden to change the approve 
button text to FileChooser.directoryOpenButtonText.
Propsosed fix is to override this method for Nimbus L&f and set the 
approve button text to FileChooser.directoryOpenButtonText.

Bug:https://bugs.openjdk.java.net/browse/JDK-8191106
webrev: http://cr.openjdk.java.net/~psadhukhan/8191106/webrev.00/

Regards
Prasanta




More information about the swing-dev mailing list