关于JAVA jframe 背景图片
publicQQFrame(intw,inth){this.setSize(w,h);this.setLocationRelativeTo(null);ImageIcon...
public QQFrame(int w,int h){
this.setSize(w, h);
this.setLocationRelativeTo(null);
ImageIcon backGroundImg = new ImageIcon( "6.jpg");
JLabel backGroundLabel=new JLabel(backGroundImg); //贴到JLabel上
this.getLayeredPane().add(backGroundLabel, new Integer(Integer.MIN_VALUE));
backGroundLabel.setBounds(0, 0, backGroundImg.getIconWidth(), backGroundImg.getIconHeight());
((JPanel)this.getContentPane()).setOpaque(false);
// this.setUndecorated(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
没有效果··各位大侠看看是不是哪错了?
在线等答案哦!!!! 展开
this.setSize(w, h);
this.setLocationRelativeTo(null);
ImageIcon backGroundImg = new ImageIcon( "6.jpg");
JLabel backGroundLabel=new JLabel(backGroundImg); //贴到JLabel上
this.getLayeredPane().add(backGroundLabel, new Integer(Integer.MIN_VALUE));
backGroundLabel.setBounds(0, 0, backGroundImg.getIconWidth(), backGroundImg.getIconHeight());
((JPanel)this.getContentPane()).setOpaque(false);
// this.setUndecorated(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
没有效果··各位大侠看看是不是哪错了?
在线等答案哦!!!! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询