JPanel重写背景图片

JPanel mainPanel = new JPanel(){
private static final long serialVersionUID = 1L;

public void paintComponent(Graphics g) 

    super.paintComponent(g);   
    g.drawImage(ImageBundle.getImageIcon("loginBackground.jpg").getImage(),0,0,this); 

};

你可能感兴趣的:(JPanel)