哪条路径我应该使用?

huangapple 未分类评论42阅读模式
英文:

Which path should I use?

问题

以下是翻译好的内容:

我有一个调用文件的类和一个运行另一个类的类,然而,我不知道应该把它放在哪里。这个文件位于 src\coutner\bldad\Runtime.java。PATH 字符串指定存储在 "pic\tricks.png":

public static final String TRICKS_PATH = "pic\\tricks.png";

以及

JLabel tricksbg = new JLabel(new ImageIcon(ImageIO.read(new File(TRICKS_PATH))));

这个文件位于 src\Main.java。现在在这里调用:

public static void main(String args[]) {
    Runtime.main(concat(new String[] {""}, args));
}

我应该在 "src\coutner\bldad\pic\tricks.png" 还是 "src\pic\tricks.png" 中指定图像文件?

英文:

I have a class that calls a file and a class that runs the other, however, I don't know where I should put it. This file is in src\coutner\bldad\Runtime.java. The PATH string says to store in "pic\tricks.png":

public static final String TRICKS_PATH = "pic\\tricks.png";

and

JLabel tricksbg = new JLabel(new ImageIcon(ImageIO.read(new File(TRICKS_PATH))));

This file is in src\Main.java. Now where this calls:

 public static void main(String args[]) {
	Runtime.main(concat(new String[] {""}, args));
 }

Should I specify the image file in "src\coutner\bldad\pic\tricks.png" or "src\pic\tricks.png"?

huangapple
  • 本文由 发表于 2020年4月4日 04:40:02
  • 转载请务必保留本文链接:https://java.coder-hub.com/61020071.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定