Using addMouseListener() and paintComponent() for JPanel

后端 未结 4 512
不知归路
不知归路 2020-11-30 12:18

This is a follow-up to my previous question. I\'ve simplified things as much as I could, and it still doesn\'t work! Although the good thing I got around using getGrap

4条回答
  •  一个人的身影
    2020-11-30 12:44

    Firstly, the PaintClass11 is never used...

    Secondly even if it was, you create two separate instances of the PaintClass22, one that is placed on the frame and one which you are trying to update...so no updates will ever occur on the screen.

    You don't need two separate classes. Merge PaintClass11 and PaintClass22 into a single class and add that to your frame

提交回复
热议问题