Object []datos = new Object [10];
TableCellRenderer renderer = new JComponentTableCellRenderer();
TableColumnModel columnModel = tbRegistradas.getColumnModel();
try {
Statement st = cn.createStatement();
ResultSet rs = st.executeQuery(sql);
while(rs.next()){
if(rs.getString(7)!= null)
{
// datos[0]="SIHAY";
JLabel lblVerde = new JLabel();
lblVerde.setIcon(new ImageIcon("images\\led-green.gif"));
datos[0] = lblVerde.getIcon();
}
else
{
// datos[0]="NOHAY";
}
datos[1]=rs.getString(1);
datos[2]=rs.getString(2);
datos[3]=rs.getString(3);
datos[4]=rs.getString(4);
datos[5]=rs.getString(5);
datos[6]=rs.getString(6);
datos[7]=rs.getString(7);
datos[8]=rs.getString(8);
datos[9]=rs.getString(9);
modelo.addRow(datos);
}
tbRegistradas.setModel(modelo);
我想链接每个班级,所以$ class =' et-first&#39 ;;等等,只是想看看如何做到这一点,因为我是一个php noob。
任何帮助都会很棒,谢谢。