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); 

};

猜你喜欢

转载自tianqiushi.iteye.com/blog/2128130