深圳住房和建设局网站网上申请,做企业网站的轻量级cms,开网站挣不挣钱,门户网站asp源码当用户单击JFrame的角落来调整大小并拖动鼠标时#xff0c;JFrame会根据用户拖动时鼠标的当前位置重绘。你怎么听这些事件#xff1f;下面是我目前尝试的#xff1a;public final class TestFrame extends JFrame {public TestFrame() {this.addComponentListener(new Compo…当用户单击JFrame的角落来调整大小并拖动鼠标时JFrame会根据用户拖动时鼠标的当前位置重绘。你怎么听这些事件下面是我目前尝试的public final class TestFrame extends JFrame {public TestFrame() {this.addComponentListener(new ComponentAdapter() {public void componentResized(ComponentEvent e) {// This is only called when the user releases the mouse button.System.out.println(componentResized);}});}// These methods do not appear to be called at all when a JFrame// is being resized.Overridepublic void setSize(int width, int height) {System.out.println(setSize);}Overridepublic void setBounds(Rectangle r) {System.out.println(setBounds A);}Overridepublic void setBounds(int x, int y, int width, int height) {System.out.println(setBounds B);}}如何确定和约束用户如何调整窗口(基于窗口的当前宽高比)的大小当他们围绕鼠标拖动