Java Tutorial

 
 
 
 
/* <applet code=\"URLDemo\"   height=100 width=400> </applet> */

import java.awt.*;
import java.applet.*;
import java.net.*;

public class URLDemo extends Applet
{
      public void paint(Graphics g){
          String msg;

          URL url=getCodeBase();
          msg = \"Code Base : \"+url.toString();
          g.drawString(msg,10,20);

          url=getDocumentBase();
          msg=\"Document Base : \"+url.toString();
          g.drawString(msg,10,40);
    }
}

    Related Post:
  1. Program to show the use of Switch Statement for the same statement for several different case labels

  2. Program to display reverse $ tree

  3. Write a class whose objects holds a current value and have a method to add that value, printing the new value

  4. Servlet which takes input from an HTML client page and calculates and outputs the premium amount

  5. Program to show an example of using multiple classes in a program

  6. Program to print some text on the same line using multiple print statements

  7. Write a class whose objects holds a current value and have a method to add that value, printing the new value

  8. Program to show an example of using Abstract Class and Abstract Method

  9. Program to show an example of Copying i.e. Clonning Objects

  10. Program to show an example of using a Non-Static Nested Class

  11. Program to search an element in an array using Linear Search

  12. Program to display bank account

  13. Program to show the use of Bitwise Operator (^) XOR (Exclusive OR)

  14. Program to append a StringBuffer by StringBuffer, String objects and other Basic Data Types

  15. Develop a game application in CORBA for which the player will guess a number between 1 to 100, which will be compared to the random number generated b

  16. RMI application for getting the final total price of the shopping list with some of the following items and quantities chosen by the user

  17. An applet program of linear sort

  18. Program to reverse the number eg given no : - 12345, output want :- 54321

  19. Program to declare, initialize and print an array of characters

  20. Program of storing and retrieving integers using data streams on a single file

 
 
Didn't find what you were looking for? Find more on An applet program to give demo of getDocumentBase() and getCodeBase() methods