Java中Exception in thread "AWT-EventQueue-0" ,在线等答案,请高手赐教!
来源:百度知道 编辑:UC知道 时间:2024/06/28 03:27:02
我的代码如下:
import java.io.File;
import java.io.IOException;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
public class ReadXLS
{
private Workbook workbook = null;
private Sheet sheet =null;
private Cell cell = null;
private String ulr;
private String con;
private String tatol;
private String[][] str;
public ReadXLS(String ulr)
{
this.ulr=ulr;
}
public String[][] readXls()
{
try
{
workbook=Workbook.getWorkbook(new File(ulr));
}
catch (BiffException e)
{
try {
throw new Exception("file to import not found!");
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
catch (IOExceptio
import java.io.File;
import java.io.IOException;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
public class ReadXLS
{
private Workbook workbook = null;
private Sheet sheet =null;
private Cell cell = null;
private String ulr;
private String con;
private String tatol;
private String[][] str;
public ReadXLS(String ulr)
{
this.ulr=ulr;
}
public String[][] readXls()
{
try
{
workbook=Workbook.getWorkbook(new File(ulr));
}
catch (BiffException e)
{
try {
throw new Exception("file to import not found!");
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
catch (IOExceptio
str[i][j] =cell.getContents();
这一行有问题的,你在仔细看看吧......
抛出NullPointerException
异常呀
贴出来的代码不全
无法回答
按照异常信息理解,应该是:
at cha.ReadXLS.readXls(ReadXLS.java:87)
ReadXLS.java 文件中的 87 行出现了空对象类型错误,好好检查一下程序逻辑,可能有些极端情况没有考虑到而出现了对象未初始化就使用的情况!
AWT-EventQueue 这个线程好像是获取windows事件并把它载入到java awt 事件队列的线程。具体问题我看不出来。可以往这方面想想。希望对你有帮助。
java中 throws Exception是干啥的
java中对于exception的处理
java中error与exception的区别是什么?
java中自定义异常为何要继承exception类
java问题exception ex
Java程序中出现Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:0是怎么回事
Java中出现 Exception in thread "main" java.lang.NoClassDefFoundError: Form
java编程中出现“Exception in thread "main" java.lang.NoclassDefFoundError:Test”是怎么回事
在Java中出现这样的错误是什么原因造成的?Exception in thread "main" java.lang.NoSuchMethodError: mai
Unhandled Exception thrown: class java.lang.ClassCastException