<Swing Dev> When running with the Nimbus look and feel, the JFileChooser does not display mnemonics for its controls.

Pavel Porvatov pavel.porvatov at oracle.com
Fri Aug 12 08:12:05 UTC 2011


Hi Charles,
> On 08/11/2011 10:02 PM, Pavel Porvatov wrote:
>> Hi Charles,
>>> On 08/08/2011 10:17 PM, Pavel Porvatov wrote:
>>>> Hi Charles,
>>>> No problem. I wrote the example (see attach) that shows the 
>>>> problem. The test works fine without patches, with the 
>>>> patch.review1 an exception is thrown, with the patch.review2 
>>>> mnemonic is missed. When I told about regressions I meant that we 
>>>> MUST keep FileChooser.lookInLabelMnemonic as an Integer. Therefore 
>>>> we have only one possible way: to use integer values (VK_XXX 
>>>> codes), but not VK_XXX names or characters.
>>>>
>>>> Regards, Pavel
>>> Here is another one :-) it uses VK_code hard coded as mental does.  
>>> If it is ok, I will like to take CR7024118. Is reflection ok to you, 
>>> Pavel?
>>>
>> Your current fix has a localization problem: it doesn't not work for 
>> other languages (the same problem described in 
>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7024118). I see 
>> the fix in the following way:
>>
>> 1. Change getting mnemonics in SynthFileChooserUIImpl like in 
>> WindowsFileChooserUI:
>> lookInLabelMnemonic = 
>> UIManager.getInt("FileChooser.lookInLabelMnemonic");
>>
>> 2. Add in synth.properties, synth_de.properties and other synth 
>> properties files:
>> FileChooser.lookInLabelMnemonic=49
>> FileChooser.folderNameLabelMnemonic=...
>> FileChooser.filesOfTypeLabelMnemonic=...
>> FileChooser.filesOfTypeMnemonic=...
>>
>> where "..." is an appropriate integer numbers. BTW: we are using 
>> integer mnemonics in other properties files, e.g. in 
>> src\share\classes\com\sun\swing\internal\plaf\basic\resources\basic.properties 
>>
>>
>> I agree that mnemonics in integer numbers is not very readable, but 
>> this way is most compatible and localizable way, I think.
>>
>> Regards, Pavel
>>
> Wow. I am fully agree with you. Let me explain a little bit about this 
> patch:
> 1. This patch is just want to keep the same things as Metal things.
> 2. After this patch, I would like to take CR7024118, and fix the 
> localization problem in CR7024118 plus in Nimbus Laf. It will be more 
> readable.
> What do you think of it, Pavel?
>
Ok, I see. But there a couple things why I'd prefer the solution 
suggested by me:
1. Obviously we shouldn't commit fixes that contains bugs
2. Your last fix will be completely removed by fix of the localization 
problem in CR7024118 plus in Nimbus Laf. So what is the reason to do 
some work that are going to be thrown away?

So lets make completed fix of CR 7032436. Note that next fix of CR 
7024118 will not interfere with CR 7032436.

Regards, Pavel



More information about the swing-dev mailing list