How to “do something” on Swing component resizing?

后端 未结 8 1174
遇见更好的自我
遇见更好的自我 2021-01-17 07:53

I\'ve a class which extends JPanel. I overwrote protected void paintComponent(Graphics g).

There is a variable which has to be recalculate

8条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-17 08:04

    If I understand the question correctly then you should read the section from the Swing tutorial on How to Write a Component Listener which shows you how to listen for a change in a components size.

提交回复
热议问题