Hallo
Ich möchte ein Bild einfügen
Leider wirft er jetzt eine Exception, welche ich nicht verstehe:
Wieso das?
Gruss
Ich möchte ein Bild einfügen
Code:
ImageIcon iconGolfball = new ImageIcon(this.getClass().getResource("D:/HTA/Semester 3/PREN1/Golfball.jpg"));
JLabel golfball = new JLabel();
golfball.setIcon(iconGolfball);
Code:
Exception in thread "main" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:138)
at Programm.GUI.initGUI(GUI.java:60)
at Programm.GUI.main(GUI.java:108)
Java Result: 1
Gruss