Auf Thema antworten

Danke,


lokal funktioniert jetzt das applet im Browser, aber online kommt nun als Fehlermeldung in der Konsole:


[CODE]java.lang.NullPointerException

    at javax.swing.ImageIcon.<init>(Unknown Source)

    at VierGewinnt.init(VierGewinnt.java:37)

    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)

    at java.lang.Thread.run(Unknown Source)

Ausnahme: java.lang.NullPointerException[/CODE]


Codeauszug:

[CODE]

public class VierGewinnt extends Applet

{

 JLabel[][] P;

   Panel P_up;

   Panel P_down;

   Label L1;

   ImageIcon image_blanko;

   ImageIcon image_red;

   ImageIcon image_blue;

   game Game;

   int player;

   boolean win;


   public void init()

   {

      java.net.URL imgURL1 = getClass().getResource("blank.png");

      java.net.URL imgURL2 = getClass().getResource("stone_red.png");

      java.net.URL imgURL3 = getClass().getResource("stone_blue.png");

      image_blanko = new ImageIcon(imgURL1); //<-- at VierGewinnt.init(VierGewinnt.java:37 ZEILE 37

      image_red    = new ImageIcon(imgURL2);

      image_blue   = new ImageIcon(imgURL3);

[/CODE]


Aber die referenz zeigt doch auf das Objekt?

Was mache ich nun falsch?


Dazu kommt auch noch das es lokal und im compiler selbst oder appletviewer funktioniert, nur online nicht :(


Hat sich erledigt, bei den Bildern ist auf dem Server PNG groß geschrieben...



Oben