做毕业设计急用,请问图片应放在哪,那段程序怎么编啊?

解决方案 »

  1.   

     Image im = null;
            TGoodsLabel = new JLabel();   
            try {
    ImageIcon img=new ImageIcon("f:/pit.jpg");//创建图片对象
                 Jbutton jb = new Jbutton(img);
                 jp.add(jb);
                 jp.pack();//自动调整
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
            JLabel lb = new JLabel();
            lb.setIcon(new ImageIcon(im));
            
            this.getContentPane().add(TGoodsLabel); 这样不对啊