class Book {
public static final ImageIcon DEGREE1 = new ImageIcon(Book.class.getResource("slike/degree1.png"));
public static final ImageIcon DEGREE2 = new ImageIcon(Book.class.getResource("slike/degree2.png"));
public static final ImageIcon DEGREE3 = new ImageIcon(Book.class.getResource("slike/degree3.png"));
public static final ImageIcon DEGREE4 = new ImageIcon(Book.class.getResource("slike/degree4.png"));
public static final ImageIcon DEGREE5 = new ImageIcon(Book.class.getResource("slike/degree5.png"));
...etc...
}
Metod getResource(fileName) baca NullPointerException ako datoteka nije pronadjena, a ja ne mogu da koristim try/catch blok ispred konstruktora izgleda. Kako da resim ovaj problem?
Hvala unapred
H
GTX 580 Lightning XE 3GB
Corsair HX750
CM Sniper