In Swing 1.1, JFrame's toFront() doesn't work when a JFrame is iconified. This works in the current version of Swing. Is there a workaround?
Just check if the frame is iconified & if not then set it to normal state and the requestfocus on it.
Use the following code:
if (MyFrame.getState() == Frame.ICONIFIED) MyFrame.setState(Frame.NORMAL); MyFrame.toFront(); MyFrame.requestFocus();