Programming a GUI with resizable components using Java.swing

后端 未结 2 1702
囚心锁ツ
囚心锁ツ 2021-01-22 22:25

I\'m supposed to program a GUI. Every component in this GUI has to have the possibility to be resized dynamically.

So far I worked with GlassPane and ContentPane, added

2条回答
  •  自闭症患者
    2021-01-22 22:58

    You have to determine the component point from your coordinate. Use this instead of p2 to to create the event:

    Point p2 = SwingUtilities.convertPoint(this.getGlassPane(), p, component);
    

提交回复
热议问题