-
problem with JDIalogBox
hi,
beside all, excuse me for my poor english;
Now, I have a problem with JDialogBox;
practically, I want to know how I must do to close all the JInternalFrame I've opened in my program, when I click on the Ok button of a JDialogBox that appears at the top.
Infact, while with JInternalFrame I can use disposeAll(), with JDialogBox I can only use dispose() method.
Who can help me?
Thank,
and excuse me again for my english.
-
I've confused as to what it is you're trying to do.
Are you trying to close all JInternalFrames in a JDesktopPane? If so, just loop through the children, calling close on each.
ArchAngel.
O:-)
-
Ok,
but how must I call the JDesktopPane from the OKButton_action_performed method of JDialogBox?
or what?
Thank.
-
I'm assuming that you must call the JDialogBox from the JDesktopPane. If so, just check the return value from the dialog box and if it is 'OK', then loop through the object's children.
ArchAngel.
O:-)
-
ArchAngel,
thank for your answer;
I call the JDialogBox from a JInternalFrame, and in his constructor I don't pass the JDesktopPane, as I do with JInternalFrame;
anyhow if I also call the JDialogBox from JDesktopPane, how can I do to say to the JInternalFrame when the JDialogBox is closed so that it can be closed?
or, how Do I do to say to the JDialogBox that must be closed all JInternalFrame with the code of OK_button_action_performed method?
-
Choose the exact message calls you want, but ultimately a method must be called on the JDesktopPane that iterates over its JInternalFrame objects which are obtained by using getAllFrames(), and then calling doDefaultCloseAction() on each one.
I also suggest you read:
http://java.sun.com/docs/books/tutor...rnalframe.html
ArchAngel.
O:-)
-
Thank you very much ArchArcangel;
I have solve the problem;
I have pass the JDesktopPane object in the constructor of JDialogBox;
then in the OK_button_action_performed I've done a loop in which I've closed each for each the JInternalFrame selected with getAllFrames();
Thank you again!!!
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks