Load image from external jar ,classpath at runtime
i have an application depends on plugins i have a case when i want to load an image from one of my plugins jar
the only way to load the image is
ClassFromPLugin.class.getClassLoader().getResource("image.png");
how can i load the image without using the ClassFromPlugin but use current Component class who need that开发者_Python百科 image
i am loading my jars at runtime , and this specific component who want to load the image don't know where it came from , he just get the image location
thank you
You must use the ClassLoader with which you loaded the jar containing the image.
精彩评论