我的主類(擴展小程序)顯示一個絕對路徑的圖像,但我不知道如何讓它從我的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