Window resize event?

后端 未结 5 2041
星月不相逢
星月不相逢 2021-02-02 07:55

I\'m writing a simple painting program using java, and I want some method to be called whenever the JFrame component is resized. But I can\'t find any method like windowRes
5条回答
  •  野的像风
    2021-02-02 08:01

    Implement a ComponentAdapter with componentResized():

    frame.addComponentListener(new ComponentAdapter() {
        public void componentResized(ComponentEvent componentEvent) {
            // do stuff
        }
    });
    

提交回复
热议问题