Estoy generando este código:
public void llenarTabla(){
this.modelSalon = new DefaultTableModel(){
public boolean isCellEditable(int row, int colum){
return false;
}
};
this.modelSalon.setColumnCount(0);
this.modelSalon.addColumn("Num_Salon");
this.modelSalon.addColumn("Cant_Camas");
this.modelSalon.addColumn("area");
this.modelSalon.addColumn("cedula_doctor");
List<Salones> lista = this.salBo.consultaTodos();
this.modelSalon.setNumRows(lista.size());
for (int i = 0; i < lista.size(); i++) {
Salones sal = lista.get(i);
this.modelSalon.setValueAt(sal.getNum_salon(), i, 0);
this.modelSalon.setValueAt(sal.getCant_camas(), i, 1);
this.modelSalon.setValueAt(sal.getArea(), i, 2);
Doctor doc = this.docBo.consultaXCedula(sal.getCedula_doctor());
this.modelSalon.setValueAt(doc.getCedula(), i, 3);
}
this.TableSalon.setModel(modelSalon);
}
Pero me envía el siguiente error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at ventanas.ManteSalon.llenarTabla(ManteSalon.java:81) at ventanas.ManteSalon.(ManteSalon.java:59) at ventanas.ManteSalon$7.run(ManteSalon.java:449) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) BUILD STOPPED (total time: 16 minutes 46 seconds)
Lo he revisado, he limpiado el programa y demás, ¡pero el problema persiste! dentro del 'sql' si existe información dentro de esos campos. ¿Podrían orientarme?
Gracias.