TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dwi Hyuga
NA
116
21.9k
My Jtable head does not appear
Jan 22 2018 3:11 AM
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.
Reply
Answers (
1
)
We use inner classes to logically group classes nd interfcs?
Exception in thread "main" java.lang.NullPointerException