Loading Image in Java Applet

后端 未结 4 603
伪装坚强ぢ
伪装坚强ぢ 2021-01-21 21:18

When I try to run an applet in applet viewer it is not able to find resources (Image). I try to load resource like this:

String cb= this.getCodeBase().toString()         


        
4条回答
  •  误落风尘
    2021-01-21 21:54

    Just use /com/blah/Images/a.png as the path. getResource() is clever enough to find it.

提交回复
热议问题