Results 1 to 4 of 4

Thread: Top Most Frame

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    UK
    Posts
    222

    Top Most Frame

    Hello, i have a JFrame and i laucnh a model dialog from it,

    is there a way of knowing the top most frame? i.e. somehow return the laucnhed dialog,

    i need this so i can reparent further dialogs over this dialog if my program needs prompting while the dialog is up...

    does this make sense?

    i.e. my program exits, i put up a dialog with a progress bar that says closing down, my program then cycles though all the underlying projects that are open in the program, and saves them, but if they need a file to save to then i need to poup a dialog to ask this, however, because the shutting down dialog ist here i can't get the file chooser popup to work..

    so is there a way of makeing the jfilechooser be parented to the top most frame, i.e. over the top of my shutdown dialog?

    cheers

    Andy

  2. #2
    Banned debbie_82's Avatar
    Join Date
    Jan 2004
    Location
    inside a hollow void
    Posts
    104
    Frame.getFrames() -- returns an array of all frames

    Then check if that frame is the active frame with isActive... then work it from there... if it is active it's either the parent of the current topmost frame or the frame itself if it doesn't have child frames.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2001
    Location
    UK
    Posts
    222
    cunning! very cunning....

    marvellous, i'll give it a go later on,

    cheers

  4. #4
    Banned debbie_82's Avatar
    Join Date
    Jan 2004
    Location
    inside a hollow void
    Posts
    104
    I hope it works for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width