1 Reply Latest reply: Jul 15, 2013 6:48 AM by 911319 RSS

    Folders that having non-ascii chars are not displaying on MAC using JFileChooser

    875776

      On MAC OS X 10.8.2, I have latest Java 1.7.25 installed. When I run my simple java program which allows me to browse the files and folders of my native file system using JFileChooser, It does not show the folders that having non-ascii char in there name. According this link, this bug had been reported for Java 7 update 6. It was fixed in 7 Update 10. But I am getting this issue in Java 1.7.21 and Java 1.7.25.

       

      Sample Code-

       

      {code}

      public class Encoding {

       

      public static void main(String[] arg) {

      try {

      //NOTE : Here at desktop there is a folder DKF}æßj having spacial char in its name. That is not showing in file chooser as well as while is trying to read for FILE type, it is not identify by Dir as well as File - getting File Not Found Exception

      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

      } catch (IllegalAccessException ex) {

      Logger.getLogger(Encoding.class.getName()).log(Level.SEVERE, null, ex);

      } catch (UnsupportedLookAndFeelException ex) {

      Logger.getLogger(Encoding.class.getName()).log(Level.SEVERE, null, ex);

      } catch (ClassNotFoundException ex) {

      Logger.getLogger(Encoding.class.getName()).log(Level.SEVERE, null, ex);

      } catch (InstantiationException ex) {

      Logger.getLogger(Encoding.class.getName()).log(Level.SEVERE, null, ex);

      }

      JFileChooser chooser = new JFileChooser(".");

      chooser.showOpenDialog(null);

      }

      }

      {code}