未处理的事件循环异常 - Eclipse

时间:2015-06-30 17:32:17

标签: java eclipse swt

我试图将Eclipse用于一个小的java代码,

        try {
        Scanner sc = new Scanner( new File("H:\\CS111\\HW\\HW1\\grades(1).csv"));
        Student[] students = new Student[10];
        int counter = 0;
        while ( sc.hasNext ()){
            String a = sc.nextLine();
            String [] arr = a.split(", ");
            System.out.println(Arrays.deepToString(arr));
            int [] grades = new int[10];
            int stdNum = Integer.parseInt(arr[0]);
            for( int i = 1 ; i < arr.length; i++){
                int value = Integer.parseInt( arr[i]);
                System.out.println(value);
                grades[i-1] = value;
            }
            Student s = new Student( stdNum, grades);
            students[counter] = s;
            counter++;
            System.out.println(Arrays.toString(grades));

        }

        PrintWriter p = new PrintWriter( "abc.txt");
        p.write("Hello");
        p.close();
        sc.close(); 

        }catch( FileNotFoundException e){
        }

    }

  }

我收到了Unhandled事件循环异常,以下是日志错误的一部分:

  org.eclipse.swt.SWTError: No more handles
    at org.eclipse.swt.SWT.error(SWT.java:4517)
    at org.eclipse.swt.SWT.error(SWT.java:4406)
    at org.eclipse.swt.SWT.error(SWT.java:4377)
    at org.eclipse.swt.widgets.Widget.error(Widget.java:482)
    at org.eclipse.swt.widgets.Control.createHandle(Control.java:703)
    at org.eclipse.swt.widgets.Label.createHandle(Label.java:199)
    at org.eclipse.swt.widgets.Control.createWidget(Control.java:743)

有人可以帮忙吗?

0 个答案:

没有答案