This discussion is archived
2 Replies Latest reply: Nov 28, 2012 4:04 AM by jsmith RSS

How to know when a Stage window is activated?

anouard Newbie
Currently Being Moderated
I'm looking for a way to know when a Stage (window) is activated or not. For instance, to change the look of the decorated window.
The Swing methods to do so are:   

            // Invoked when a window is activated.
            public void windowActivated(WindowEvent e) {
                System.out.println("Window Activated Event");
            // Invoked when a window is de-activated.
            public void windowDeactivated(WindowEvent e) {
                System.out.println("Window Deactivated Event");
            // Invoked when a window state is changed.
            public void windowStateChanged(WindowEvent e) {
                System.out.println("Window State Changed Event");
I know the setOnXXX() methods from Stage class but I didn't find the equivalent for "activation".
Many thanks.


  • Correct Answers - 10 points
  • Helpful Answers - 5 points