/** carga la tabla de asistencia por horas */ private void cargarTablaHoras(String inici, String fi) { java.sql.Time hInici; java.sql.Time hFin; SimpleDateFormat formato = new SimpleDateFormat("HH:mm"); SimpleDateFormat formato3 = new SimpleDateFormat("HH:mm"); DecimalFormat formato2 = new DecimalFormat("0"); ArrayList<String> header = new ArrayList<String>(); // cabecera header.add(language.getProperty("estadisticas.table.personalAcademico.horas")); header.add(language.getProperty("estadisticas.table.personalAcademico.asistencia")); String[][] gridData; List<String> row; try { if (inici.equals("")) hInici = null; else hInici = new java.sql.Time(formato.parse(inici).getTime()); if (fi.equals("")) hFin = null; else hFin = new java.sql.Time(formato3.parse(fi).getTime()); ; matriculas = manager.consultarHoras(hInici, hFin); gridData = new String[matriculas.size()][4]; int i = 0; float total; float cos = 0; for (Matricula matricula : matriculas) { cos = matricula.getAsis() + matricula.getNoAsis(); total = matricula.getAsis() / cos; total = total * 100; gridData[i][0] = formato.format(matricula.getHoraInicio()); gridData[i][1] = formato2.format(total) + "%"; i++; } tablaHoras.setModel( new DefaultTableModel(gridData, header.toArray()) { @Override public boolean isCellEditable(int row, int column) { return false; } }); } catch (ParseException ex) { JOptionPane.showMessageDialog( null, language.getProperty("err.formatoHora"), language.getProperty("app.title"), JOptionPane.ERROR_MESSAGE); } catch (SQLException ex) { JOptionPane.showMessageDialog( null, language.getProperty("err.sql") + "\n" + language.getProperty("err.detail") + ":\n\n" + ex.getMessage(), language.getProperty("app.title"), JOptionPane.ERROR_MESSAGE); // Registra el error en un archivo de LOG // Logger.getLogger(FrmResourcesRequest.class.getName()).log(Level.SEVERE, null, ex); } catch (RemoteException ex) { JOptionPane.showMessageDialog( null, language.getProperty("err.rmi") + "\n" + language.getProperty("err.detail") + ":\n\n" + ex.getMessage(), language.getProperty("app.title"), JOptionPane.ERROR_MESSAGE); // Registra el error en un archivo de LOG // Logger.getLogger(FrmResourcesRequest.class.getName()).log(Level.SEVERE, null, ex); } catch (Exception ex) { JOptionPane.showMessageDialog( null, language.getProperty("err.generic") + "\n" + language.getProperty("err.detail") + ":\n\n" + ex.getMessage(), language.getProperty("app.title"), JOptionPane.ERROR_MESSAGE); // Registra el error en un archivo de LOG // Logger.getLogger(FrmResourcesRequest.class.getName()).log(Level.SEVERE, null, ex); } }