Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

Focus on a frame

 
 
Allan Valeriano
Guest
Posts: n/a
 
      03-20-2007
Hi all,

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

setAlwaysOnTop(true);
requestFocusInWindow();

but it didn't work.
I also tried

setAlwaysOnTop(true);
requestFocus();


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
Guest
Posts: n/a
 
      03-20-2007
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
requestFocus().

> but it didn't work.


Can you provide an SSCCE that shows
this behaviour?
<http://www.physci.org/codes/sscce.html>

Andrew T.

 
Reply With Quote
 
 
 
Reply

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



Advertisments