Results 1 to 5 of 5
  1. #1
    Jarob22 is offline Member
    Join Date
    Mar 2011
    Posts
    12
    Rep Power
    0

    Smile How to set a JFrame as focus

    Hey there,

    I'm developing a GUI and wish to set an options frame as the focus so that you cannot click on the main window whilst the options frame is up. I've tried setFocusable(true) and requestFocus() but neither seem to work.

    I've had a look at the api and can't find anything myself.

    Thanks in advance!

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

  3. #3
    Jarob22 is offline Member
    Join Date
    Mar 2011
    Posts
    12
    Rep Power
    0

    Default

    Oh, I've never heard of a JDialog before. I'll go look it up now - thanks a lot.

  4. #4
    Jarob22 is offline Member
    Join Date
    Mar 2011
    Posts
    12
    Rep Power
    0

    Default

    Haha, 10 seconds of replacing a couple of bits of code and that works great.

    Thanks again Fubarable.

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

Similar Threads

  1. Maintain focus on JFrame
    By nik_meback in forum AWT / Swing
    Replies: 2
    Last Post: 12-15-2010, 01:39 PM
  2. Replies: 5
    Last Post: 06-14-2010, 06:10 PM
  3. Replies: 6
    Last Post: 04-12-2010, 11:33 AM
  4. Passing data from one JFrame to another JFrame
    By tarami in forum New To Java
    Replies: 3
    Last Post: 08-06-2009, 05:44 PM
  5. Replies: 4
    Last Post: 04-22-2009, 11:02 PM

Tags for this Thread

Posting Permissions

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