problem with JDIalogBox
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?
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.
but how must I call the JDesktopPane from the OKButton_action_performed method of JDialogBox?
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.
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:
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!!!
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center