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!

JFileChooser set focus to specific directory

843806May 7 2008 — edited May 8 2008
Is it possible to set the JFileChooser to grab focus on the previous selected directory in directory only mode from the textfield containing the selected file name?

The behavior I am seeking is to show the chooser with a directory already selected and or highlighted. I have tried the set selected file method and that does not highlight the file as if the user selected the file. I keep getting various behaviors where I set the selected folder. In the file name text component it shows upper level directories at times instead of the directory I specified. The focus is typically located on the file name text component and I would rather have the focus on the directory entry specified in the file name text. Is that possible with JFileChooser?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2008
Added on May 7 2008
4 comments
459 views