日期:2014-05-20 浏览次数:20703 次
ImageIcon image = new ImageIcon("C:\\myworkspace\\catchhtmlpic\\google.png"); this.getContentPane().remove(img1); img1 = new JLabel(image);// put pic in img1。 add(img1, BorderLayout.CENTER); this.pack();
ImageIcon image = null; if(loadpicFlag) image = new ImageIcon("C:\\myworkspace\\catchhtmlpic\\google.png"); else image = new ImageIcon("C:\\myworkspace\\catchhtmlpic\\aaaaa.png"); loadpicFlag = !loadpicFlag; this.getContentPane().remove(img1); img1 = new JLabel(image);// put pic in img1。 add(img1, BorderLayout.CENTER); this.pack();