G
Guest
Gast
Hallo zusammen,
ich bekomme bei meinem Applet eine NullPointerException die ich mir
a) nicht erklären kann
b) nicht weiß wie ich diese abfange
Das ist mein Codegerüst:
In der Zeile mit "<--" bekomme ich folgende Exception:
Getestet habe ich das ganze derzeit nur in Eclipse.
Hat dazu jemand eine Idee?
ich bekomme bei meinem Applet eine NullPointerException die ich mir
a) nicht erklären kann
b) nicht weiß wie ich diese abfange
Das ist mein Codegerüst:
Code:
public class MyFrame extends JApplet{
public void showError(String errornr, String errormsg){
AppletContext ac = this.getAppletContext(); // <--
}
In der Zeile mit "<--" bekomme ich folgende Exception:
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at java.applet.Applet.getAppletContext(Unknown Source)
at my.applet.MyFrame.showError(MyFrame.java:81)
at my.applet.client.ClientCallbackImpl.sendError(ClientCallbackImpl.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at de.root1.simon.ReadEventHandler.processInvokeMethod(ReadEventHandler.java:399)
at de.root1.simon.ReadEventHandler.run(ReadEventHandler.java:103)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Getestet habe ich das ganze derzeit nur in Eclipse.
Hat dazu jemand eine Idee?