java - Reading file from path in Swing in different environments -


i creating swing application in of icons , images being loaded resource folder within project.

file helpicon = new file("resources/icon/helpicon.png"); 

this working fine in windows in linux code giving error. how should handle in different operating systems (like windows, linux, macos)?

try use getclass().getresources("path")


Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

file - Python: AttributeError: 'str' object has no attribute 'readlines' -

c# - Get the Class name in a class with atribute inside a attribute method -