Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • 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: 5155
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.


 
Space pants. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!