import java.applet.Applet; import java.awt.Label; import java.awt.Graphics; import java.awt.Dimension; public class Simple extends Applet { String release; Label l; public void init() { l = new Label(); add(l); } public void paint(Graphics g) { Dimension d = null; try { d = getSize(); //1.1 code l.setText("You are using JDK release 1.1."); doLayout(); //1.1 code } catch (NoSuchMethodError e) { d = size(); //1.0.2 code l.setText("You are using JDK release 1.0.2."); layout(); //1.0.2 code } g.drawRect(0, 0, d.width - 1, d.height - 1); } }