Frames Switching Manager in MDI Java Application



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

.



Relevant Pages

  • Re: F95 standard
    ... Because it was a trip forward in functionality. ... I couldn't stand Frame. ... Support the Original G95 Project: http://www.g95.org ...
    (comp.lang.fortran)
  • Re: F95 standard
    ... Because it was a trip forward in functionality. ... I couldn't stand Frame. ... The irony is so strong as to almost make it on topic. ...
    (comp.lang.fortran)
  • Re: Trying to access a JavaScript variable in one frame from another frame.
    ... I'm trying to add functionality without a complete redsign. ... I've got the following frame structure at the top level: ... END MAINFRAME CODE FRAGMENT ...
    (comp.lang.javascript)
  • frame hide
    ... iam developing gui with glade, ... now the functionality i need is when i press a button the frame ... press event the other frame has to be visible and all the remaining ...
    (comp.unix.programmer)
  • Re: How to receive events from a jcombobox in an internal Jpanel ??
    ... I've a Frame with two Jpanel, in Jpanel1 I've a Jcombobox and it's ... listener while in Jpanel2 I've a JLabel where I want to write the ... My question is how I can receive in the main Frame the event coming ...
    (comp.lang.java.help)