wood burning stoves 2.0*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem while disposing JFileChooser" Watch "Problem while disposing JFileChooser" New topic
Author

Problem while disposing JFileChooser

Piyush Tripathi
Greenhorn

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
Sheriff

Joined: Oct 27, 2005
Posts: 19543
    
  16

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):


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem while disposing JFileChooser
 
Similar Threads
Difficulties with JFileChooser
How to open a file using Java
How to deal with a JFileChooser
JFileChooser (Open File Dialog)
JFileChooser open and cancel button