Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Folder's name having non-ascii char are not showing in JFileChooser in Java 1.7.25 on MAC O.S.

875776Jul 15 2013

On MAC OS X 10.8.2, I have latest Java 1.7.25 installed. I have packaged my swing application using "Java FX" ANT Task on MAC. When I run my program and try 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 and had been fixed in 7 Update 10. 

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}

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 12 2013
Added on Jul 15 2013
0 comments
251 views