// GenericApplet.java // template for applet //experiment in appletviewer and browser reload, restart, uncovering, back/forward etc. import java.awt.Graphics; import javax.swing.*; public class GenericApplet extends JApplet { public void init() { JOptionPane.showMessageDialog(null,"hello from init()"); } public void start() { JOptionPane.showMessageDialog(null,"hello from start()"); } public void paint( Graphics g ) { super.paint( g ); // call paint method inherited from JApplet JOptionPane.showMessageDialog(null,"hello from paint()"); g.drawLine(5, 5, 40, 40); g.drawRect(10, 10, 50, 30); g.drawOval(10, 10, 40, 40); g.drawString("in paint",20,20); } public void stop() { JOptionPane.showMessageDialog(null,"hello from stop()"); } public void destroy() { JOptionPane.showMessageDialog(null,"hello from destroy()"); } }