import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class Exercise2_7 extends Applet implements ActionListener{
//求三个整数的最小值
Label result=new Label(" hello ");
TextField n1=new TextField(" ");
TextField n2=new TextField(" ");
TextField n3=new TextField(" ");
Button btn=new Button("求最小值");
public void init(){
setLayout(new FlowLayout());
add(n1);
add(n2);
add(n3);
add(btn);
add(result);
btn.addActionListener(this);
}
public void actionPerformed(ActionEvent e){
int i1,i2,i3;
i1=Integer.parseInt(n1.getText());
i2=Integer.parseInt(n2.getText());
i3=Integer.parseInt(n3.getText());
result.setText(String.valueOf(seek_for_min(i1,i2,i3)));
}
public int seek_for_min(int a,int b,int c){
int min;
if(a<=b){
min=a;
}else{
min=b;
}
if(min>=c)
min=c;
return min;
}
}
哪里出错了,望回复