August 2004
Intermediate to advanced
480 pages
9h 41m
English
Let's just write an applet and try to view it and see what comes out of the woodwork, shall we?
package net.javagarage.applets;
import java.awt.Color;
import java.awt.Container;
import java.awt.FlowLayout;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JLabel;
/**
* <p>
* Example of very simple JApplet.
* @author eben hewitt
*/
public class SimpleApplet extends JApplet {
public void init() {
Container content = getContentPane();
content.setBackground(Color.PINK);
content.setLayout(new FlowLayout());
content.add(new JLabel("Hello, world"));
content.add(new JButton("Poke me"));
}
}
This applet doesn't do much at all. You see a label, you see a button, you press the button, nothin' ...
Read now
Unlock full access