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

January 24, 2009 Leave a comment Go to comments

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):


Advertisement
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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: