• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

null pointer Exception getcodebase()

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai ,excuseme i new one to this forum.so i don't know abt previous posts.
I urgently need solution for my problem.

this is my program


public static void main(String args[])
{
CheckApplet c =new CheckApplet();

String str=c.getCodeBase().getHost();
System.out.println(str);
}

at java.applet.Applet.getCodeBase(Applet.java:136)
at CheckApplet.main(CheckApplet.java:17)

plz give me solution for this problem
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

getCodeBase() is implemented by calling out to another class in the applet package, "AppletStub". The browser provides an AppletStub object by calling the Applet's setStub() method when the Applet is created. If you want to use an applet outside of a regular container, and that applet needs to use any of the methods whose implementations depend on there being an AppletStub, then you have to implement an AppletStub subclass yourself and call Applet.setStub() to register it.
 
And then the flying monkeys attacked. My only defense was this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic