Hi
I created a method which changes the icon of all jradiobuttons from a buttongroup:
public void setRadioButtonIcons(final ButtonGroup gruppe){
Enumeration<AbstractButton> gruppeEnum = gruppe.getElements();
while (gruppeEnum.hasMoreElements()){
AbstractButton radio = gruppeEnum.nextElement();
Icon unselIcon = new ImageIcon( Thread.currentThread().getContextClassLoader().getResource("checkbox0.jpg").getPath());
Icon selIcon = new ImageIcon( Thread.currentThread().getContextClassLoader().getResource("checkbox1.jpg").getPath());
radio.setIcon(unselIcon);
radio.setSelectedIcon(selIcon);
}
}
This works fine under Ubuntu with Java 1.6.0_16.
When I use the methode under windows 7 with java 1.6.0_18, the icons do not apear. They are simply missing. The programm does not throw a Nullpointer... it finds the icons, but does not display them. Any ideas? It seems somewhat hard to believe that I can not use such a simple functionality under windows.
I tried it with gif and jpg. I also put the images inside the jar and tried to load them from the filesystem -> same result.
Edit: In this configuration, the files are loaded from the jar.