On 03/30/2011 07:43 PM, Pavel Porvatov wrote:
Hi Charles,
Hi guys,
When running with Nimbus LaF, JFileChooser does not display mnemonics
for its controls, see FileNameAndTypeNomnemonics.png (attached)
After patch (attached)
You will find FileNameAndTypeWithMnemonics.png (attached)
I filed CR 7032436 (When running with the Nimbus look and feel, the
JFileChooser does not display mnemonics) for the described problem
Thanks, Pavel
Hi guys,
I have tested this issue on the openjdk 8 and it still there. Attached
is a patch which rebased on the openjdk8.
Would anyone like to put this patch into the openjdk8 and fix this issue?
--
Yours Charles
diff --git src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties
index 0900aa3..b9874b4 100644
--- src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties
+++ src/share/classes/com/sun/java/swing/plaf/windows/resources/windows.properties
@@ -45,3 +45,8 @@ FileChooser.fileSizeHeaderText=Size
FileChooser.fileTypeHeaderText=Type
FileChooser.fileDateHeaderText=Modified
FileChooser.fileAttrHeaderText=Attributes
+FileChooser.lookInLabelMnemonic=I
+FileChooser.fileNameLabelMnemonic=N
+FileChooser.folderNameLabelMnemonic=F
+FileChooser.filesOfTypeLabelMnemonic=T
+FileChooser.filesOfTypeMnemonic=T
diff --git src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal.properties src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal.properties
index f7fd7fc..0f1fa63 100644
--- src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal.properties
+++ src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal.properties
@@ -43,6 +43,11 @@ FileChooser.fileSizeHeaderText=Size
FileChooser.fileTypeHeaderText=Type
FileChooser.fileDateHeaderText=Modified
FileChooser.fileAttrHeaderText=Attributes
+FileChooser.lookInLabelMnemonic=I
+FileChooser.fileNameLabelMnemonic=N
+FileChooser.folderNameLabelMnemonic=F
+FileChooser.filesOfTypeLabelMnemonic=T
+FileChooser.filesOfTypeMnemonic=T
############ Used by MetalTitlePane if rendering window decorations############
# All mnemonics are KeyEvent.VK_XXX as integers
diff --git src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth.properties src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth.properties
index d222689..c06d43f 100644
--- src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth.properties
+++ src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth.properties
@@ -43,3 +43,8 @@ FileChooser.fileSizeHeaderText=Size
FileChooser.fileTypeHeaderText=Type
FileChooser.fileDateHeaderText=Modified
FileChooser.fileAttrHeaderText=Attributes
+FileChooser.lookInLabelMnemonic=I
+FileChooser.fileNameLabelMnemonic=N
+FileChooser.folderNameLabelMnemonic=F
+FileChooser.filesOfTypeLabelMnemonic=T
+FileChooser.filesOfTypeMnemonic=T
diff --git src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
index e971d9d..4ab61f2 100644
--- src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
+++ src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java
@@ -473,16 +473,16 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
Locale l = fc.getLocale();
- lookInLabelMnemonic = getMnemonic("FileChooser.lookInLabelMnemonic", l);
+ lookInLabelMnemonic = (int)(UIManager.getString("FileChooser.lookInLabelMnemonic", l).charAt(0));
lookInLabelText = UIManager.getString("FileChooser.lookInLabelText", l);
saveInLabelText = UIManager.getString("FileChooser.saveInLabelText", l);
- fileNameLabelMnemonic = getMnemonic("FileChooser.fileNameLabelMnemonic", l);
+ fileNameLabelMnemonic = (int)(UIManager.getString("FileChooser.fileNameLabelMnemonic", l).charAt(0));
fileNameLabelText = UIManager.getString("FileChooser.fileNameLabelText", l);
- folderNameLabelMnemonic = getMnemonic("FileChooser.folderNameLabelMnemonic", l);
+ folderNameLabelMnemonic = (int)(UIManager.getString("FileChooser.folderNameLabelMnemonic", l).charAt(0));
folderNameLabelText = UIManager.getString("FileChooser.folderNameLabelText", l);
- filesOfTypeLabelMnemonic = getMnemonic("FileChooser.filesOfTypeLabelMnemonic", l);
+ filesOfTypeLabelMnemonic = (int)(UIManager.getString("FileChooser.filesOfTypeMnemonic", l).charAt(0));
filesOfTypeLabelText = UIManager.getString("FileChooser.filesOfTypeLabelText", l);
upFolderToolTipText = UIManager.getString("FileChooser.upFolderToolTipText",l);
@@ -501,11 +501,6 @@ public class SynthFileChooserUIImpl extends SynthFileChooserUI {
detailsViewButtonAccessibleName = UIManager.getString("FileChooser.detailsViewButtonAccessibleName",l);
}
- private int getMnemonic(String key, Locale l) {
- return SwingUtilities2.getUIDefaultsInt(key, l);
- }
-
-
public String getFileName() {
if (fileNameTextField != null) {
return fileNameTextField.getText();