Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Setting JFrame to be only selectable window

  1. #1
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,608
    Thanks
    24
    Thanked 316 Times in 295 Posts

    Default Setting JFrame to be only selectable window

    I have a program where you have the main Frame and a secondary Frame that pops up. The secondary Frame holds progress bars. I want to set the secondary frame to be the only selectable frame until it closes on its own. How can I do that? I've been searching Google but no one has an answer that actually works...


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,067
    Thanks
    47
    Thanked 2,146 Times in 2,119 Posts

    Default Re: Setting JFrame to be only selectable window

    Can you use a modal dialog instead of a Frame?

  3. #3
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,608
    Thanks
    24
    Thanked 316 Times in 295 Posts

    Default Re: Setting JFrame to be only selectable window

    A little bit of messing around and I got it to work. Thanks Norm.

    However now I have another question. How can I force close the Dialog when a method is called? I cant seem to find a method related to that.

    I'm actually not wanting to do this entire set only selectable window thing. Just realized it is stopping my process from running...
    Last edited by aussiemcgr; July 22nd, 2010 at 10:33 AM.

  4. #4
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    489
    Thanks
    8
    Thanked 45 Times in 43 Posts

    Default Re: Setting JFrame to be only selectable window

    Quote Originally Posted by aussiemcgr View Post
    How can I force close the Dialog when a method is called? I cant seem to find a method related to that.
    setVisible(false)
    // or
    dispose()

    I'm actually not wanting to do this entire set only selectable window thing. Just realized it is stopping my process from running...
    Your "process" (whatever that might refer to) probably shouldn't be running on the EDT in that case.

    To get better help sooner, post a SSCCE
    link --> SSCCE : Java Glossary

    db

Similar Threads

  1. cmd.exe DOS Window
    By Curious in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: March 1st, 2010, 09:30 AM
  2. how to make a simple JButton on a JFrame window?
    By chronoz13 in forum AWT / Java Swing
    Replies: 8
    Last Post: November 20th, 2009, 09:08 PM
  3. switch focus to another window
    By tuansoibk in forum AWT / Java Swing
    Replies: 1
    Last Post: November 13th, 2009, 01:02 PM
  4. Navigating from one window to another
    By visharaddhavle83 in forum AWT / Java Swing
    Replies: 2
    Last Post: August 6th, 2009, 07:55 AM
  5. I'm not sure how to initialize GraphicsDevice and Window
    By DotChris in forum AWT / Java Swing
    Replies: 3
    Last Post: July 15th, 2009, 09:00 AM