• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Double Duty FileChooser

 
Isaac Hewitt
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a FileChooser with FileFilter for one task and for a second task I remove the Filter, but what I have is the last file name selected int the FileChooser which I have tried to remove when switching to the other use of the FileChooser


 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> but what I have is the last file name selected int the FileChooser which I have tried to remove when switching...

when you switch, include this line
fileChooser.setSelectedFile(new File(""));
 
Darryl Burke
Bartender
Posts: 5132
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Dunn wrote:when you switch, include this line
fileChooser.setSelectedFile(new File(""));

So long as the file selection mode isn't DIRECTORIES_ONLY
 
Isaac Hewitt
Ranch Hand
Posts: 191
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Michael Dunn. This works below.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic