Advertisements
Home > Java > Java Program to write an applet with message on Status Bar – Q48

Java Program to write an applet with message on Status Bar – Q48


Q48: Java Program to write an applet which displays its code base and document base and show a message on the status bar and display the received parameters which were passed to this applet.

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

public class Ap_Paths extends Applet{
	
	String msg;
	
	public void paint(Graphics g){
	
		URL url_cb = getCodeBase();
		msg = "CodeBase: " + url_cb.toString();
		g.drawString(msg, 20, 30);
		
		URL  url_db = getDocumentBase();
		msg = "Doc. Base: " + url_db.toString();
		g.drawString(msg, 20, 60);
		
	}
}

… from College notes (BCA/MCA assignments):


Advertisements
Categories: Java Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: