Classx.class.getResource("/com/sun/java/swing/plaf/windows/icons/ListView.gif");
Classx.class.getResource("/javax/swing/plaf/metal/icons/ocean/expanded.gif");
How can I get resource on JDK 11, which is working on JDK 8?
I have tried getClass(), ClassLoader, but I am getting null.
In OpenJDK 11 don't include that resources.jar library by default. So you have to manually add the resources jar file.
If you check the java 8 lib directory there is a
resources.jarfile that contains all those icons. In OpenJDK 11 it does not exist. like XML bind and other libraries removed from the standard java 11 package.Please add external library and use your code to get resource.