// <applet code="NewClassApplet" width="400" height="400"></applet>
import java.awt.*;
import javax.swing.*;
public class NewClassApplet extends JApplet {
public void init() {
JButton jb = new JButton("Send");
// This is useless here.
//jb.setVisible(true);
JPanel panel = new JPanel();
panel.add(jb);
getContentPane().add(panel);
// An alternate approach:
//getContentPane().add(panel, "Last");
}
public void paint(Graphics g) {
// One of the few times you need to call
// "super" in a paint method is if
// the container has light-weight children.
// This method will draw on top of children.
super.paint(g);
g.drawString("Hello",10,10);
}
}