This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "query" Watch "query" New topic


rachita mahendru

Joined: Oct 17, 2001
Posts: 6
question is that when we click on the close button of the JInternalframe a save filedialog box is popped up we want that if we click on the save option the changes made must be saved in the specified file but when we click on the cancel option or close button of the Save filedialog box, then, only the dialog box should get disposed not the internal frame so that if the user wants to make some more changes he can do so and then save it afterwards
but when we click on the cancel option of the Save FileDialog the JInternal Frame and the File Dialog both gets disposed.
please give us the solution to get rid of it
we have tried hide() and dispose() method of the dialog box
but could not find the solution
thank u

Joined: Sep 21, 2001
Posts: 17

I think u should take help of the interface called VetoableChangeListener. ur JInternalFrame class extension should implement this interface and add this listener using addVetoableChangeListener() method. this listener "vetoes" the closing of JInternalFrame if customized to do so.
explore it!!
hope it helps u.
I agree. Here's the link:
subject: query