• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multipe Frames to front

 
Torsten Wiederkehr
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have got three frames. If I activate frame 1 I want to also bring frame 2 + 3 to front, but must stay to frame 1.

I tried.
public void windowActivated(WindowEvent e) {
frame2.toFront();
frame3.toFront();
frame1.requestFocus();
}

This brings all frames to the front, but the focus remains at frame3.

I also tried:
public void windowActivated(WindowEvent e) {
frame2.toFront();
frame3.toFront();
frame1.toFront();
}

This ends in an endless loop of bringing all the frames to the front again and again.
In the second version I also used a semaphore to avoid the endless loop, but it didn't work.

Any suggests how to bring multiple frames to the front if one of the is selected?


Cheers,

Torsten
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try:
 
Torsten Wiederkehr
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I tried it, but I still hang up in an endless loop :-((
 
Justin Chu
Ranch Hand
Posts: 209
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try putting a condition that tests whether it is in front or not.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> If I activate frame 1 I want to also bring frame 2 + 3 to front, but must stay to frame 1.

I'm reading this that you are activating the frame from the taskbar.
If so, something like this might work

 
Torsten Wiederkehr
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not only activating the frame from the task bar. I'm also using ALT-TAB or just klicking on it.
 
Torsten Wiederkehr
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I finally came up with the following solution:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!