I am trying to use a star image in a program, but I can’t figure out how to import it into my project so I can just say “star.jpg” instead of a whole long file name (which doesn’t even work sometimes).
How can I do this?
Here’s my source line -
ImageIcon ii = new ImageIcon(this.getClass().getResource("star.jpg"));