当我在我的代码中使用多线程时,我得到了以下惊人的异常,但是我不知道它发生在哪里。此外,此异常仅有时会发生。
线程“AWT-EventQueue-0”中的异常 java.util.NoSuchElementException:javax.swing.plaf.basic.BasicTableHeaderUI.getPreferredSize(BasicTableHeaderUI.java) 的 java.util.Vector$1.nextElement(Vector.java:348) 的向量枚举:793) 在 javax.swing.JComponent.getPreferredSize(JComponent.java:1660)
我在我的应用程序中使用以下代码进行多线程。
try {
Thread Thread4 = new Thread() {
public void run() {
GetOrderData(mID, "OrderInfo_Orn");
}
};
Thread4.start();
Thread4.sleep(20);
Thread Thread5 = new Thread() {
public void run() {
GetOrderData(mID, "OrderInfo_Parts");
}
};
Thread5.start();
Thread5.sleep(20);
Thread queryThread = new Thread() {
public void run() {
GetMasterData(mID, rowId);
}
};
queryThread.start();
queryThread.sleep(20);
Thread Thread2 = new Thread() {
public void run() {
GetDetailData(mID, "'RcvPrePolishGoods_Detail'");
}
};
Thread2.start();
Thread2.sleep(20);
Thread Thread3 = new Thread() {
public void run() {
GetDetailData(mID, "'RcvPrePolishGoods_Parts'");
}
};
Thread3.start();
Thread3.sleep(20);
} catch (InterruptedException ex) {
Logger.getLogger(RcvPrePolishGoods.class.getName()).log(Level.SEVERE, null, ex);
}