write an applet that display the directory


Write an applet that display the directory holding the HTML file that started the applet and the directory from which, applet class file was loaded.

An applet is here given below, which display the directory holding the HTML file which started the applet:

import java.awt .*;

import java.applet .*;    //import package

import java.net .*;

public class Base extends Applet

{

public void piant (Graphics g)

{

String msg;

URL url = getCodebase( );  / / string is initialize to be displayed.

Msg = "Code base:" +url . tost ring( );

g.drawst ring(msg,10,20);

URL url = getDocumentbase() ;

Msg = "Document base: " +url . tost ring();

g.drawst ring(msg,10,40);

}

}

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: write an applet that display the directory
Reference No:- TGS0283268

Expected delivery within 24 Hours