How to set a background picture in JPanel

前端 未结 3 953
猫巷女王i
猫巷女王i 2020-11-22 14:40

hello i am using JPanel as my container of my frame then i really want to used a background picture in my Panel i really need help this is my code so far . this is the updat

3条回答
  •  一整个雨季
    2020-11-22 15:15

    JPanel ping = new JPanel(){
    
    @Override
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
    
    //draw hare what ever you want and it will be in the back of your components
       }
    };
    

提交回复
热议问题