Que objeto de la tabla debo incluir en NULL y como.
Estos datos se muestra en la Tabla.
De antemano Gracias.
Código (java) [Seleccionar]
modelo = new DefaultTableModel(null, titulos) {
public Class getColumnClass(int column) {
if (column >= 0 && column <= getColumnCount())
return getValueAt(0, column).getClass();
else
return Object.class;
}
};
Estos datos se muestra en la Tabla.
Código (java) [Seleccionar]
String[] titulos = {"Vendedor","Efectivo ", "Efectivo Cja", "Dato"};
String[] registro = new String[4];
modelo = new DefaultTableModel(null, titulos);
Connection cn = Conexion.getConnection();
String sSQL = "SELECT usuario.usuario, reportediario.gananciaTotal, reportediario.efectivoBruto "+
"FROM reportediario " +
"INNER JOIN usuario ON usuario.id_us=reportediario.id_us ";
try
{
Statement st = cn.createStatement();
ResultSet rs = st.executeQuery(sSQL);
int i=0;
while(rs.next())
{
registro[0] = rs.getString("usuario.usuario");
registro[1] = rs.getString("reportediario.gananciaTotal");
registro[2] = rs.getString("reportediario.efectivoBruto");
registro[3] = String.valueOf(i);
i++;
modelo.addRow(registro);
}
jTable1.setModel(modelo);//Buscador Princiapal
modelo = new DefaultTableModel(null, titulos) {
public Class getColumnClass(int column) {
if (column >= 0 && column <= getColumnCount())
return getValueAt(0, column).getClass();
else
return Object.class;
}
};
}
catch (SQLException ex){
JOptionPane.showMessageDialog(null, ex);
}
TableRowSorter<TableModel> elQueOrdena = new TableRowSorter<TableModel>(modelo);
jTable1.setRowSorter(elQueOrdena);
De antemano Gracias.