problem with JDIalogBox


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: problem with JDIalogBox

  1. #1
    Join Date
    Jun 2003
    Posts
    17

    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.



    anonimocampano@katamail.com
    (capienza 2,5 Mb)

  2. #2
    Join Date
    Mar 2003
    Posts
    834
    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:-)

  3. #3
    Join Date
    Jun 2003
    Posts
    17
    Ok,
    but how must I call the JDesktopPane from the OKButton_action_performed method of JDialogBox?

    or what?

    Thank.



    anonimocampano@katamail.com
    (capienza 2,5 Mb)

  4. #4
    Join Date
    Mar 2003
    Posts
    834
    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:-)

  5. #5
    Join Date
    Jun 2003
    Posts
    17
    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?



    anonimocampano@katamail.com
    (capienza 2,5 Mb)

  6. #6
    Join Date
    Mar 2003
    Posts
    834
    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:-)

  7. #7
    Join Date
    Jun 2003
    Posts
    17
    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!!!



    anonimocampano@katamail.com
    (capienza 2,5 Mb)

  8. #8
    Join Date
    Mar 2003
    Posts
    834
    No probs!
    ArchAngel.
    O:-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center