/*
* <applet code="ResizeMe" width="200" height="200"></applet>
*/
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class ResizeMe extends applet {
final int inc = 25;
int max = 500;
int min = 200;
Dimension d;
public void paint(Graphics g) {
d = getSize();
g.setColor(Color.black);
g.drawLine(0,0,d.width,d.height);
g.drawLine(0,d.width,d.height,0);
g.drawString(d.width + " x " + d.height, 10, 20);
}
public void processMouseEvent(MouseEvent evt) {
int w = (d.width+ inc)>max?min:(d.width+inc);
int h = (d.height+ inc)>max?min:(d.height+inc);
resize(w,h);
}
}