X-VIPRIN
X-VIPRIN

Reputation: 39

How could I add and image to a JLabel, when the image is in a parent directory in Java?

Using java

Lets pretend we are in folder "src". The parent directory contains folders "src", "assets" and "bin". Since I am in the folder "src", how could I get an image from "assets" folder, when it is a parent directory? I would then like to put this image into an ImageIcon and add it to a JLabel, etc.

A source code example is all that is needed, I can work from there.

Upvotes: 0

Views: 35

Answers (0)

Related Questions