Sample code from JavaApplets and Applications at the JavaScript/Java site at BellaOnline.com

Simple Application

Code:
/* SimpleApplication -  a very basic appication that prints a line of text. */
/*               an example for http://java.bellaonline.com                 */
/*                       Julie L Baumler 20071014                           */

class SimpleApplication {
    public static void main(String[] args) {
	// Print the line of text
        System.out.println("I am a very boring application.");
    }
}

Download SimpleApplication code

Simple Applet

Applet:
Simple Java Applet
Code:
/* SimpleApplet -  a very basic applet that prints a line of text. */
/*           an example for http://java.bellaonline.com            */
/*                    Julie L Baumler 20071014                     */

import java.applet.Applet;
import java.awt.Graphics;

public class SimpleApplet extends Applet {
    public void init() {
	resize(150,25);
    }
    public void paint(Graphics g) {
	g.drawString("I am a very boring applet", 50, 25);
    }
}

Download SimpleApplet code


copyright 2007 Julie L Baumler