I have a problem when running a program. I am simulating a Processor with java and I am saving the variables in a list and showing them in a JTable, in this program I have a variable that is the one of cycles that must go in decrement every time I call a Threar.sleep (). All that if my program does the problem that I have is when it comes to show my data.
the part that does the subtraction of the cycles is inside a Do while and a cycle For For what I understand the For is the one that does not let me Update my JTable I want to see how it is subtracting the cycles and the states in the table. the only way I could make the changes in my JTable show is by setting a JOptionPane.ShowMessage I do not know if there is a way to update my jtable or if they have any proposal to update my JTable
this is the code I use:
if(e.getSource()==frmControl.btnEjecutar){
IProcesoDao dao = new ProcesoDaoImpl();
List<mdlProceso> Proceso = new ArrayList<>();
do{
int ciclos;
Proceso=dao.Obtener();
frmControl.gridMostrarProceso(Proceso);
for(int i =0; i<Proceso.size();i++){
ciclos = Integer.parseInt(Proceso.get(i).getCiclos());
if(Nuevo(Proceso.get(i).getStatus())||
Procesando(Proceso.get(i).getStatus())){
if( ciclos>0){
dao.ciclosAct(modProceso,String.valueOf(Proceso.get(i).getPid()));
dao.actualizar(modProceso,String.valueOf(Proceso.get(i).getPid()));
estableceTimer();
}else{
dao.finalizar(modProceso,String.valueOf(Proceso.get(i).getPid()));
Proceso=dao.Obtener();
frmControl.gridMostrarProceso(Proceso);
}
}
}
}while(recorrerTabla()==true);
}