質問

Possible Duplicate:
Java AWT/Swing: Get notified on change of position/size of my window

Is there an event for JFrame size changing? I tried

addWindowStateListener(new java.awt.event.WindowStateListener() {
          public void windowStateChanged(WindowEvent e) {
              System.out.println("Size Changed");
     }
   });

But it works only with minimizing and maximizing. I want to trigger even a small window (JFrame) size change done by dragging the edges. Thank you.

役に立ちましたか?

解決

You can use a ComponentListener:

myJFrame.addComponentListener(new ComponentAdapter() {
            public void componentResized(ComponentEvent e) {
                System.out.println("Size Changed");
            }
        });
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top