所以我需要加载图像并将它们放在jButtons上。
ImageIcon imageicon = new ImageIcon(getClass().getResource(path));
我只能加载同样位于项目文件夹中的图像,并且在编译之后它们都在jar中 这里的问题是我无法从jar外部加载其他图像
ImageIcon imageicon = new ImageIcon(path);
我可以从jar外部加载图像,但不能再加载jar中的图像。
有没有办法将这些东西结合起来?我需要一个可以加载图像的函数,该图像具有来自jar的相对路径和来自硬盘的absoluth路径