I have an application (with imageicons) jarred.
The application at first didn't load the images. After reading in topics here I understanded that this should be the right implementation for reading image icons out of jars:
unDoButton = new JButton(new ImageIcon(this.getClass().getClassLoader().getResource("img/vorige.jpg")));
reDoButton = new JButton(new ImageIcon(this.getClass().getClassLoader().getResource("img/volgende.jpg")));
treeViewButton = new JButton(new ImageIcon(this.getClass().getClassLoader().getResource("img/mappen.jpg")));
weergaveButton = new JButton(new ImageIcon(this.getClass().getClassLoader().getResource("img/weergave.jpg")));
bovenLiggendeMapButton = new JButton(new ImageIcon(this.getClass().getClassLoader().getResource("img/bovenLiggendeMap.jpg")));
After jarring the application, and running the jar file, nothings happens.
Changing it back to:
unDoButton = new JButton(new ImageIcon("img/vorige.jpg"));
..the application works, only the icons aren't loaded.
Anyone suggestions?
Greets,
Sjoerd