0% found this document useful (0 votes)
14 views2 pages

Tugas 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Tugas 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

----------------------------------------------------------------------------------------------------------------------

KODEEEEEEEEEEEEEEEEEEE

1. FROM UTAMA
private void btnsiswaActionPerformed(java.awt.event.ActionEvent evt) {
dp.removeAll();
fromsiswa siswa=new fromsiswa();
dp.add(siswa);
siswa.show();
}

2. FROM SISWA
public class fromsiswa extends javax.swing.JInternalFrame {

/**
* Creates new form fromsiswa
*/
private final DefaultTableModel model;
public fromsiswa() {
initComponents();

model=new DefaultTableModel();
tblsiswa.setModel(model);
model.addColumn("N I S");
model.addColumn("Nama Siswa");
model.addColumn("Kota");
getdata();
}
public void getdata() {
model.getDataVector().removeAllElements();
model.fireTableDataChanged();
try{
Statement stat=(Statement) db_sekolahly.getkoneksi().createStatement();
String sql="select * from tbsiswa";
ResultSet res=stat.executeQuery(sql);
while(res.next()){
Object [] obj=new Object[3];
obj[0]=res.getString("nis");
obj[1]=res.getString("nama");
obj[2]=res.getString("kota");
model.addRow(obj);
}
}catch(SQLException err) {

JOptionPane.showMessageDialog(null, err.getMessage());
}
}

ISI DARI TABLENYA


1. jLabel = INFORMASI DATA SISWA =-
2. jTable = - = tblsiswa

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy