Frames Switching Manager in MDI Java Application
- From: k.galanos@xxxxxxxxx
- Date: 24 Feb 2006 02:02:29 -0800
What this is supposed to be is a manager that will switch focus to each
open frame in a MDI application as appropriate, like the Alt-Tab
functionality in Windows. I have captured the key event using a key
listener which I add to every frame when it is created. Everything
works fine until the user decides to close a frame. Then the key
listener seems not to function anymore. I seem to lose the focus
somewhere but I don't know where!
At frame closing I give the focus to the next frame using the following
code:
frame.toFront(); //frame is JInternalFrame
frame.grabFocus(); //or frame.requestFocus(), etc
System.out.println("Has frame got focus? " + frame.hasFocus());
The last line always displays false. Has anyone come by a similar
problem? Advice would be greatly appreciated!
Regards in advance
.
- Prev by Date: Re: Editor / Renderer: data flow
- Next by Date: Re: How to make Image size as the label has?
- Previous by thread: In JTree Not Able To Move Selection From One Node To Other
- Next by thread: how do I veto a setSelected() on JCheckBox
- Index(es):
Relevant Pages
|