Results 1 to 4 of 4
  1. #1
    javastuden's Avatar
    javastuden is offline Senior Member
    Join Date
    Nov 2009
    Posts
    160
    Rep Power
    5

    Default diapose the child frame if already opened or block to open a new one

    hi
    how can i check whether a Jframe is opened or not
    on clicking a button a new frame is pop up and some function that's ok but i clicked the same button the same frame is opened again again on clicking the same button how can i block this means if already opened

    Thanks in advance

  2. #2
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    6

    Default

    The simplest (if not best) answer is to extend the Frame by adding a boolean variable.
    Initialize it to false. When the Frame is opened, set it true.
    If the variable is true, do not open the window.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Do you want instead to use a modal JDialog here instead of a JFrame? That would prevent any action from occurring on the main GUI until the dialog has been completely dealt with. Or if you must use a non-modal dialog, you could disable the button, and attach a listener to the dialog to see when it closes, and then re-enable the button.

  4. #4
    javastuden's Avatar
    javastuden is offline Senior Member
    Join Date
    Nov 2009
    Posts
    160
    Rep Power
    5

    Default my problem regarding the child window is attached

    Thanks to reply
    my problem regarding the child window is attached
    the gui is build by java gui builder older version so
    Recompile with -Xlint:deprecation for details.
    note will generate

    please advice me in the code

    thank you
    Attached Files Attached Files

Similar Threads

  1. Replies: 0
    Last Post: 03-23-2009, 04:19 PM
  2. Deleting a File that is opened
    By ravian in forum Advanced Java
    Replies: 6
    Last Post: 01-30-2008, 02:05 PM
  3. Reading an already opened file
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-25-2008, 06:50 PM
  4. Replies: 0
    Last Post: 12-04-2007, 11:11 AM
  5. How to know the ports opened by JVM
    By sandeepspatil in forum Advanced Java
    Replies: 1
    Last Post: 08-02-2007, 01:51 PM

Posting Permissions

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