日期:2014-05-20 浏览次数:20851 次
URL url1 = urlload.findResource("Images/background.jpg"); Image img1 = Toolkit.getDefaultToolkit().getImage(url1); backgroundLabel = new JLabel(new ImageIcon(img1)); this.getLayeredPane().add(backgroundLabel, new Integer(Integer.MIN_VALUE)); backgroundLabel.setBounds(0,0,800,600); ((JPanel)getContentPane()).setOpaque(false); setVisible(true);
public void paint(Graphics g){ super.paint(g); // do your thing.... }