怎样给窗体换背景图片java
1个回答
2017-12-06
展开全部
jContentPane = new JPanel(){
Image image = new ImageIcon("image\\main.png").getImage();
public void paintComponent(Graphics g)
{
super.paintComponent(g);
g.drawImage(this.image, 0, 0, getWidth(), getHeight(), 0, 0, this.image.getWidth(null), this.image.getHeight(null), null);
}
};
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询