Java: Finally found in the alloy in the JFileChooser pop-up menu does not display the text of the solution

Source: Internet
Author: User
Tags locale

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.