Get image from relative path

前端 未结 8 1903
囚心锁ツ
囚心锁ツ 2021-02-03 13:01

In my project I have 2 packages. images - contain images and notification - contain java files

In notification/main.java I get Image o

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-03 13:31

    i've also been on this and it turns out that you need to create a package inside of your src folder. for instace if you create a package called images inside of the src folder, your relative path will be /images/yourimage.png.

    Notice that the slash(/) must be there! more info here http://forums.macrumors.com/showthread.php?t=533922

    it worked for me

提交回复
热议问题