> Hi,
>
[quoted text clipped - 3 lines]
> Is this the easiest way? Also is it possible to remove the x from the
> top of the frame so it can only be closed using a JButton?
Not sure if this is the best way but why not add a WindowFocusListener to
the frame you want to retain focus, then when it loses focus request the
focus again?
addWindowFocusListener(new WindowAdapter() {
public void windowLostFocus(WindowEvent evt) {
requestFocusInWindow();
}
});
--
Mike W
Ben - 19 Mar 2006 12:38 GMT
In the end I found that I can used setEnabled(false) on the forms to
stop users clicking on them.
Will also use
addWindowFocusListener(new WindowAdapter() {
public void windowLostFocus(WindowEvent evt) {
requestFocusInWindow();
}
});
because if forms clicked on task bar they get focus even though they
can't be used.
Ben - 19 Mar 2006 12:41 GMT
Actually
addWindowFocusListener(new WindowAdapter() {
public void windowLostFocus(WindowEvent evt) {
requestFocusInWindow();
}
});
didn't work when used with setEnabled(false)