Forcing focus on a JInternalFrame

Hi all,

I have a JFrame, which has a JInternalFrame inside, what i want to do is basically force the focus to the internal frame. It has the same concept as a JDialog, where you cant have focus anywhere until the window is closed.

I think there's a window listener which can detect if a window has lost focus. However i do not know how to "focus" on the internal frame. Any suggestions?

Thanks.

[422 byte] By [TrAnScEnD3nTa] at [2007-11-27 9:52:28]
# 1

> I think there's a window listener which can detect if

> a window has lost focus. However i do not know how to

> "focus" on the internal frame. Any suggestions?

Yah! there is..

frame.addWindowFocusListener(new java.awt.event.WindowFocusListener() {

public void windowGainedFocus(WindowEvent e) {

}

public void windowLostFocus(WindowEvent e) {

}

});

Yannixa at 2007-7-13 0:21:33 > top of Java-index,Desktop,Core GUI APIs...
# 2
> has the same concept as a JDialog, where you cant have focus anywhere until the window is closed. Then use a JDialog. A JInternalFrame is not designed for this purpose.
camickra at 2007-7-13 0:21:33 > top of Java-index,Desktop,Core GUI APIs...