35. 阅读下列程序,请写出该程序的功能。
import java. applet. *;import java. awt. *;
public class Test3 5 extends Applet{
public void paint(Graphics g){
setSize(3 80,200);
for(int i=0;i<1 0;i++){
Color myredcolor=new Color(i*25+5,0,0);
g. setColor(myredcolor);
g. fillRect(i*32+5,2,28,28);
}
}
}
36. 阅读下列程序,请写出该程序的功能。
import java. applet. *;import java.awt.*;import java. awt. event. *;
public class Test36 extends Applet {
final int inc=25;
int max=500;int min=200;
Dimension d;
public void init() {
addMouseListener(new MouseAdapter() ){
public void mouseReleased(MouseEvent me){
int w=(d. width+inc)>max?min:(d. width+inc);
int h=(d. height+inc)>max?min:(d. height+inc);
setSize(new Dimension(w,h));
}
}
}
public void paint(Graphics g){
d=getSize();
g. drawLine(0,0,d. width-1,d. height-1);
g. drawLine(0,d. height-1,d. width-1,0);
g. drawRect(0,0,d. width-1,d. height-1);
}
}