Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem while disposing JFileChooser

 
Piyush Tripathi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am calling JFileChooser from a class which extends JFileChooser. I have to add the funtionality for file overwrite error message. In the class which extends the file chooser i am overriding method approveSelection() in which i am checking whether the file already exists.My problem is when the the JOption dialog for YES/NO/CANCEL appears when i want to overwrite the file i am pressing yes option but the JFileChooser dialog is not disposing off.

Following is a method from where i am calling the class which extends JFileChooser :




Following is a class in which i am overriding the approveSelection method :

 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you call super.approveSelection() if the file can be overridden? I did the same in one of my classes, and that works just fine (acceptFilter is a java.io.FileFilter):
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic