Skip to Main Content

New to Java

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!

Problem with JFileChooser Execution

985357Jan 16 2013 — edited Jan 18 2013
I wanted to write a code using JFileChooser so that I can use File Selector as part of my application.
I took the sample code online and executed on my local machine. It worked fine. But when I deployed my code on Application server, I got surprised to see that after running my program, the File Chooser pop up comes on Application server machine and not on User Machine.
Please suggest.

Following is the piece of code which I got online and used in my application to launch File Selector.
JFileChooser chooser = new JFileChooser();
chooser.setCurrentDirectory(new java.io.File("."));
chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
chooser.setMultiSelectionEnabled(true);

chooser.showOpenDialog(null);

Edited by: 982354 on Jan 16, 2013 6:08 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 15 2013
Added on Jan 16 2013
5 comments
207 views