JPanel not showing background image

后端 未结 2 1714
野趣味
野趣味 2021-01-22 19:27

It is very simple program and i have tried my best but the JPanel doesn\'t come up with a background image. I just want a simple background image on my panel.

Here is my

2条回答
  •  攒了一身酷
    2021-01-22 20:26

    Replace

    public void printComponent(Graphics g) {
    

    with

    @Override
    public void paintComponent(Graphics g) {
      super.paintComponent(g);
    

提交回复
热议问题