我的主类(扩展小程序)显示一个绝对路径的图像,但我不知道如何让它从我的html所在的文件夹中获取路径。小应用程序与图像
try {
tutorial2 = TextureLoader.getTexture("PNG", new FileInputStream(
new File("D:/eclipse/workspace/Final/res/tutorial2.png")));
} catch (IOException e) {
e.printStackTrace();
System.err.println("Nu s-a gasit imaginea");
}
但我的html applet是在另一个目录中,我希望当你移动html仍然查看图像。
您可能会发现[如何使小程序(HTTP:/ /docs.oracle.com/javase/tutorial/uiswing/components/applet.html)教程有帮助 – MadProgrammer