日期:2014-05-19  浏览次数:20716 次

谁能帮我测试一下java ee。出错时我按钮继续运行,不再提示,结果现在有错误也不提示了。
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package homework;

/**
 *
 * @author Administrator
 */
/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Fan {

  int SLOW = 1, MEDIUM = 2, FASE = 3;
  private int speed = SLOW;
  private boolean on = false;
  private double radius = 5;
  private String color = "blue";

  public Fan() {
  }

  public void setspeed(int s) {
  this.speed = s;
  }

  public void setstate(boolean a) {
  this.on = a;
  }

  public void setradius(double r) {
  this.radius = r;
  }

  public void setcolor(String b) {
  this.color = b;
  }

  public int getspeed() {
  return speed;
  }

  public boolean getstate() {
  return on;
  }

  public double getradius() {
  return radius;
  }

  public void toString(boolean on) {
  if (on == true) {
  System.out.println("Fan打开了; " + "Fan的半径: " + radius + "\n" + "速度:" + speed + "\n" + "颜色: " + color + "\n");

  } else if (on == false) {
  System.out.println("Fan被关闭了");
  }
  }

  public void choose1() {
  Scanner input = new Scanner(System.in);
  System.out.println("1.状态 2.风速 3.半径 4.颜色 5.退出");
  int j = input.nextInt();
  while (j != 5) {
  if (j != 1 && j != 2 && j != 3 && j != 4) {
  System.out.println("输入有误,请重新输入!!!");
  } else if (j == 1) {
  System.out.println("1.关闭风扇 2.打开风扇");
  int k = input.nextInt();
  if (k == 1) {
  setstate(false);
  } else {
  setstate(true);
  }
  break;
  } else if (j == 2) {
  System.out.println("1.slow 2.middle 3.fast");
  int k = input.nextInt();
  if (k == 1) {
  setspeed(1);
  } else if (k == 2) {
  setspeed(2);
  } else {
  setspeed(3);
  }
  break;
  } else if (j == 3) {
  System.out.println("输入半径");
  int k = input.nextInt();
  setradius(k);
  break;
  } else if (j == 4) {
  System.out.println("输入颜色");
  String m = input.toString();
  setcolor(m);
  break;
  }
  }
  }

  public void choose2() {
  boolean jan = getstate();
  toString(