Dwi Hyuga

Dwi Hyuga

  • NA
  • 116
  • 21.9k

My Jtable head does not appear

Jan 22 2018 3:11 AM
  1. DefaultTableModel tabmod = new DefaultTableModel(new String[]{"No.PO""No.detail PO""TglPO""Nama Compound""Type""Warna""Qty""part""Deskripsi""Keterangan"}, 0);  
  2.         String sql3 = "select NoPO, NouPO, TglPO, part, Qty from tbl_tmb where sisPart > '0'";  
  3.         try{  
  4.             stmt = lpi.createStatement();  
  5.             rs = stmt.executeQuery(sql3);  
  6.             while(rs.next()){  
  7.                 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") +"'";  
  8.                 try{  
  9.                     pst = mpi.prepareStatement(sql4);  
  10.                     ls = pst.executeQuery();  
  11.                     while(ls.next()){  
  12.                         String NoPO = rs.getString("NoPO");  
  13.                         String NouPO = rs.getString("NouPO");  
  14.                         String tglPO = ls.getString("TglPengiriman");  
  15.                         String NamCom = ls.getString("nama");  
  16.                         String type = ls.getString("type");  
  17.                         String warna = ls.getString("warna");  
  18.                         String Qty = rs.getString("Qty");  
  19.                         String part = rs.getString("part");  
  20.                         String desk = ls.getString("Description");  
  21.                         String ket = ls.getString("Ket");  
  22.                         tabmod.addRow(new Object[]{NoPO, NouPO, tglPO, NamCom, type, warna, Qty, part, desk, ket});  
  23.                     }  
  24.                 }catch(SQLException e){  
  25.                     System.out.println(e.getMessage());  
  26.                 }  
  27.             }  
  28.         }catch(SQLException e){  
  29.             System.out.println(e.getMessage());  
  30.         }  
  31.         tabut = new JTable();  
  32.         tabut.setModel(tabmod);  
  33.         tabut.setBounds(10701325250); 

the values are shown, but the header does not appear, what's wrong with my code? please help me.


Answers (1)