by onlyhuman » Wed Apr 23, 2014 1:17 am
I made a test today:
I've put this line in my code:
System.out.println(String.format("Key: %s value: %s\tgetClass().getResourceAsStream: %s\tDualList.class.getResourceAsStream: %s", key, result, getClass().getResourceAsStream(result)==null?"NOT found":"FOUND", DualList.class.getResourceAsStream(result)==null?"NOT found":"FOUND"));
And I got this result:
Key: dualList.moveLeft.icon value: /com/my/companylsyh/path/to/images/someIcon.png getClass().getResourceAsStream: FOUND DualList.class.getResourceAsStream: NOT found
So the problem is: my custom class's classloader find the searched icon, but DualList.class's classloader does not. Would it be possible to change your code from DualList.class.getResourceAsStream to getClass().getResourceAsStream? Or is there any workaround?
Thanks in advance!