Get Applet Directory URL or Code Base Example

Example Output

Want to learn quickly?
Try one of the many quizzes. More than Java 400 questions with detailed answers.

Add Comment

  • As of Java 7u25, this will crash. The Applet.getCodeBase() function now returns null if the applet was loaded from a local file (see the 7u25 release notes for more).


Facebook Fans