Java Blog

 
 
 
/* <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 Bitwise Operator (&) AND

  2. Program to show an example of creating a class and using its object

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

  4. An applet program that concatenates two string entered in TextField

  5. Program to read input from the Standard Input Device

  6. Program to show the use of operator (&gt;&gt;&gt;) Shift Right, filling with zeros from the left

  7. Program to ask question and accept answer up to 3 attempt and display right answer if it is wrong

  8. Program for Thread Priority

  9. 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

  10. Program to determine the sum of the following harmonic series for a given value of n

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

  12. Program to read the ballots and count the votes cast for each candidate using an array variable count

  13. Program to display following things on the client machine a)date and time of the server machine b)date and time of the client machine and difference

  14. 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

  15. Program of date server and client

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

  17. Program to show an example of Polymorphism

  18. Program to show an example of using constructors in a class to initialize its data members

  19. Program to show an example of using a Static Nested Class

  20. Corba program of UDP client server application which sends the news to the client. Server takes the news from the NewsDataFile located at the server

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