Results 1 to 5 of 5
Thread: How to set a JFrame as focus
- 03-06-2011, 04:08 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 12
- Rep Power
- 0
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!
-
Don't use another JFrame but rather a modal JDialog for this. This is precisely what they're best used for.
- 03-06-2011, 04:13 PM #3
Member
- Join Date
- Mar 2011
- Posts
- 12
- Rep Power
- 0
Oh, I've never heard of a JDialog before. I'll go look it up now - thanks a lot.
- 03-06-2011, 04:16 PM #4
Member
- Join Date
- Mar 2011
- Posts
- 12
- Rep Power
- 0
Haha, 10 seconds of replacing a couple of bits of code and that works great.
Thanks again Fubarable.
-
Similar Threads
-
Maintain focus on JFrame
By nik_meback in forum AWT / SwingReplies: 2Last Post: 12-15-2010, 01:39 PM -
to pass a parameter from a jframe children to its jframe mother
By anix in forum NetBeansReplies: 5Last Post: 06-14-2010, 06:10 PM -
Passing data from one JFrame to another JFrame. - need help.
By Unsub in forum New To JavaReplies: 6Last Post: 04-12-2010, 11:33 AM -
Passing data from one JFrame to another JFrame
By tarami in forum New To JavaReplies: 3Last Post: 08-06-2009, 05:44 PM -
How to make a Jframe un-focusable when another Jframe is active?
By Robert_85 in forum Advanced JavaReplies: 4Last Post: 04-22-2009, 11:02 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks