This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Problem while disposing JFileChooser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem while disposing JFileChooser" Watch "Problem while disposing JFileChooser" New topic

Problem while disposing JFileChooser

Piyush Tripathi

Joined: Jan 28, 2009
Posts: 16
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

Joined: Oct 27, 2005
Posts: 19847

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

How To Ask Questions How To Answer Questions
It is sorta covered in the JavaRanch Style Guide.
subject: Problem while disposing JFileChooser