The upstair tell you a best way You can extends JWindow override show() like this: public void show() { supershow(); thisrequestFocus(); } and then add a window listener for the focus lost event: addFocusListener (new javaawteventFocusAdapter () { public void focusLost (javaawteventFocusEvent evt) { thistoFront(); } } ); It seems to work for me You can also try to use thread I recommend this way /** * Call this from class consructor */ public void initialize() { TopThread top = new TopThread(); topstart(); } /** * Keep JWindow on top (inner class) */ class TopThread extends Thread { public void run() { while(true) { toFront(); /** * Let milliseconds for other code to execute */ try { Threadsleep(); } catch(Exception e) { // do what you wanna do } } } } You can see:?forum=&thread= Thats some others discuss it |