Java Swing - Translucent Components causing Artifacts

前端 未结 3 1453
闹比i
闹比i 2021-01-21 02:18

I\'m currently working on a group project for a college course, and I\'ve hit a bit of a stumbling block. The program we have decided to implement is a Peer-to-Peer chat client

3条回答
  •  有刺的猬
    2021-01-21 03:15

    Try JFrame.repaint(). That should work. If you want custom designing of your JFrame then you will have to override paint() method of JFrame. Additionally, if you want each component to be custom designed you will have to override the paint() method of each of your GUI component. Couple of things to note:

    1. You do not have to call paint() for any GUI component. You only need to call repaint().
    2. In case you do the overriding of the other GUI components [JButton, JTextField...], you do not have to call their repaint() method. The parent Container's [JFrame, JPanel...] repaint() will do the job.

提交回复
热议问题