解决方案 »

  1.   

    提示的  错误
    Exception in thread "main" java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:468)
    at java.lang.Integer.parseInt(Integer.java:497)
    at ClockPaint.<init>(Clock.java:88)
    at Clock.main(Clock.java:62)
      

  2.   

    public ClockPaint(int x, int y, int r) 方法在
    控件还没显示的时候就被调用了       s = Integer.parseInt(Clock.t3.getText()) * 6;// 获得秒转换成度数
            m = Integer.parseInt(Clock.t2.getText()) * 6;// 获得分钟
            h = Integer.parseInt(Clock.t1.getText())* 6;// 获得小时从文本框取值的时候当然取得都是 空值   转换int一定报错啊   加个判断getText()如果返回空值  给个默认值  比如 “0”   什么的