import java.applet.*; import java.awt.*; public class draw extends Applet { // do nothing in constructor public draw() { } public void init() { } public void start() { } public void stop() { } public void destroy() { } public void paint(Graphics g) { // get sizes int realWidth = size().width; int realHeight = size().height; double imagWidth = 20.0; double imagHeight = 10.0; double deltaX = realWidth / imagWidth; double deltaY = realHeight / imagHeight; // now draw a picture g.drawOval((int) (deltaX * 5.0), (int) (deltaY * 5.0), (int) (deltaX * 3.0), (int) (deltaY * 3.0)); } }