- DefaultTableModel tabmod = new DefaultTableModel(new String[]{"No.PO", "No.detail PO", "TglPO", "Nama Compound", "Type", "Warna", "Qty", "part", "Deskripsi", "Keterangan"}, 0);
- String sql3 = "select NoPO, NouPO, TglPO, part, Qty from tbl_tmb where sisPart > '0'";
- try{
- stmt = lpi.createStatement();
- rs = stmt.executeQuery(sql3);
- while(rs.next()){
- String sql4 = "select b.nama, b.type, b.warna, a.Description, a.Ket, c.TglPengiriman from tbl_po_dtl as a left join tbl_daftar_item as b on a.NmBrg=b.id left join tbl_po as c on a.NoPO=c.NoPO where a.NoPO='"+ rs.getString("NoPO") +"' && a.NoUrutPO='"+ rs.getString("NouPO") +"'";
- try{
- pst = mpi.prepareStatement(sql4);
- ls = pst.executeQuery();
- while(ls.next()){
- String NoPO = rs.getString("NoPO");
- String NouPO = rs.getString("NouPO");
- String tglPO = ls.getString("TglPengiriman");
- String NamCom = ls.getString("nama");
- String type = ls.getString("type");
- String warna = ls.getString("warna");
- String Qty = rs.getString("Qty");
- String part = rs.getString("part");
- String desk = ls.getString("Description");
- String ket = ls.getString("Ket");
- tabmod.addRow(new Object[]{NoPO, NouPO, tglPO, NamCom, type, warna, Qty, part, desk, ket});
- }
- }catch(SQLException e){
- System.out.println(e.getMessage());
- }
- }
- }catch(SQLException e){
- System.out.println(e.getMessage());
- }
- tabut = new JTable();
- tabut.setModel(tabmod);
- tabut.setBounds(10, 70, 1325, 250);
the values are shown, but the header does not appear, what's wrong with my code? please help me.