Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Focus on a frame

Thread Tools

Focus on a frame

Allan Valeriano
Posts: n/a
Hi all,

how can I get a JFrame to be the focused window on top of all others?
I've tried


but it didn't work.
I also tried


but it seems that those aren't the right methods to do that.
Does anybody knows how can I get the frame to be on top of all others
and be the focused window?

Reply With Quote
Andrew Thompson
Posts: n/a
On Mar 21, 12:52 am, "Allan Valeriano" <(E-Mail Removed)> wrote:
> how can I get a JFrame to be the focused window on top of all others?
> I've tried

> I also tried
> setAlwaysOnTop(true);
> requestFocus();

To some extent, it depends where, when,
under what circumstances these methods
are called. A quick test here showed
no problems getting focus (Win XP, Java 6)
to the second of three JFrames using

> but it didn't work.

Can you provide an SSCCE that shows
this behaviour?

Andrew T.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
this.window.focus() vs. window.focus() vs. this.focus() Roger Javascript 3 03-08-2007 08:53 PM
Pan Focus vs Auto Focus JethroUK© Digital Photography 2 08-11-2004 06:26 PM
Set focus on a form element in one frame from a different frame Arvin Portlock Javascript 4 07-12-2004 09:33 PM
frame reload() -> reloaded frame gets the focus Harald Henkel Javascript 0 11-10-2003 06:10 PM
any manual focus cameras easy to focus? Catherine Jo Morgan Digital Photography 6 11-05-2003 06:36 PM