The alloy interface can be said to be the most beautiful Java interface I have ever written.
Unfortunately for some reason, it has not been updated since the release of the 1.4 version a few years ago.
As the Java version has been upgraded, it has been worrying that alloy will someday be no longer applicable to the latest version of Java.
Now in the java6.0 with alloy, feel still very good, is JFileChooser dialog box on the right click, the popup menu text is blank, make people feel uncomfortable.
Today, I finally found a solution:
I first found a class that is critical for JFileChooser: Sun.swing.FilePane
I don't understand why I put Filepane in the sun.swing bag.
Online search, see a lot of people say this Filepane class does not have the source code, but I feel the problem and this class is very related.
To download a Java anti-compilation software to the Web, and then to the JDK directory will be Rt.jar decompression, with the anti-compilation software Filepane class decompile, after my line of inspection, finally found the problem:
Filepane.java
protected voidinstalldefaults () {Java.util.Locale Locale=Getfilechooser (). GetLocale (); Listviewborder= Uimanager.getborder ("Filechooser.listviewborder"); Listviewbackground= Uimanager.getcolor ("Filechooser.listviewbackground"); Listviewwindowsstyle= Uimanager.getboolean ("Filechooser.listviewwindowsstyle"); ReadOnly= Uimanager.getboolean ("Filechooser.readonly"); Viewmenulabeltext= Uimanager.getstring ("Filechooser.viewmenulabeltext", Locale); Refreshactionlabeltext= Uimanager.getstring ("Filechooser.refreshactionlabeltext", Locale); Newfolderactionlabeltext= Uimanager.getstring ("Filechooser.newfolderactionlabeltext", Locale); Viewtypeactionnames=NewString[2]; viewtypeactionnames[0] = uimanager.getstring ("Filechooser.listviewactionlabeltext", Locale); viewtypeactionnames[1] = uimanager.getstring ("Filechooser.detailsviewactionlabeltext", Locale); Kilobytestring= Uimanager.getstring ("Filechooser.filesizekilobytes", Locale); Megabytestring= Uimanager.getstring ("Filechooser.filesizemegabytes", Locale); Gigabytestring= Uimanager.getstring ("Filechooser.filesizegigabytes", Locale); }
Workaround:
Uimanager.put ("Filechooser.viewmenulabeltext", "View");
Uimanager.put ("Filechooser.newfolderactionlabeltext", "New Folder");
Uimanager.put ("Filechooser.refreshactionlabeltext", "refresh");
Uimanager.put ("Filechooser.listviewactionlabeltext", "List");
Uimanager.put ("Filechooser.detailsviewactionlabeltext", "detailed information");
2007-10-27
Java: Finally found in the alloy in the JFileChooser pop-up menu does not display the text of the solution