ImageIcon icon=new ImageIcon(getClass().getResource(".\\yourjpg.jpg"));

解决方案 »

  1.   

    ImageIcon icon=new ImageIcon(getClass().getResource(".\\yourjpg.jpg"));
      

  2.   

    我已经按照(Xioyoo)你地方法做了,访问被拒绝的问题解决了,可是在运行过程当中有出现了"Do not use LogicCircuit.add() use LogicCircuit.getContentPane.add() instead"请问可能是什么原因,我试图改正,可是没有成功,我觉得这可能是由于在Panel中新添加JLabel引起的,在我以前想Panel中加组建的时候没有出现这种情况.