往类MainFrame中的(private)readyjList中添加内容,
MainFrame:
public void setReadyList(Vector ve){
readyjList.setListData(ve);
}
Process:
private Vector rQueue = null;
public void create(String name,int len){
int i=rQueue.size();
pcb[i].setAddr(i);
pcb[i].setName(name);
pcb[i].getProg().setLength(len);
readyc++;pCount++;
String str=i+" "+name;
rQueue.add(str);
mf.setReadyList(rQueue);
}
出现异常:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at process_os.Process.create(Process.java:120)
为什么不能添加成功? |