essayer avec :
getClass().getResourceAsStream("/exit.png")
// noter l'ajout du slash.
voir doc:
The getResource and getResourceAsStream methods find a resource with a given name. They return null if they do not find a resource with the specified name. The rules for searching for resources associated with a given class are implemented by the class's ClassLoader. The Class methods delegate to ClassLoader methods, after applying a naming convention: if the resource name starts with "/", it is used as is. Otherwise, the name of the package is prepended, after converting all periods (.) to slashes (/).
si çà n'a pas marché, poster une image sur la structure de votre projet
Partager