0

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"?

  • 2
    You shouldn't be betting these images as files regardless as you are trying to do. They should be obtained as resources. – Hovercraft Full Of Eels Apr 03 '20 at 20:42
  • 1
    Please see [What's the difference between a Resource, URI, URL, Path and File in Java?](https://stackoverflow.com/questions/27845223/whats-the-difference-between-a-resource-uri-url-path-and-file-in-java) – Hovercraft Full Of Eels Apr 03 '20 at 20:44

0 Answers0