java的安全机制,你无法访问除了本文件夹及其子文件夹中的内容。

解决方案 »

  1.   

    我現在只是本機測試,都不通過.why???
      

  2.   

    因该使用 getResource()方法得到图标资源,因该改成
    Icon icon1 = new ImageIcon(
          AppletMain.class.getResource("station1.gif"));以上假设station1.gif打包时和AppletMain.class放在一起,或者像下面一样使用绝对路径
    Icon icon1 = new ImageIcon(
          AppletMain.class.getResource("/org/jdraw/example/treedoc/images/station1.gif"));
      

  3.   

    其实用ToolKit.CreateImage()就可以了。
      

  4.   

    To gtlang78:
      多谢你答复。要不然我都不知道该不该给分了。