daftar penjualan
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package nmTransaksi;
import Class.classkoneksi;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JRootPane;
import javax.swing.table.DefaultTableModel;
/**
*
* @author RPL
*/
public class DaftarPenjualan extends javax.swing.JFrame {
/**
* Creates new form DaftarPenjualan
*/
public DaftarPenjualan() {
setUndecorated(true);
getRootPane().setWindowDecorationStyle(JRootPane.NONE);
initComponents();
this.setLocationRelativeTo(this);
}
public void selectData(){
DefaultTableModel table = new DefaultTableModel();
table.addColumn("Id Penjualan");
table.addColumn("Tanggal");
table.addColumn("Judul");
table.addColumn("Penulis");
table.addColumn("Harga Jual");
table.addColumn("Jumlah");
try{
String SQL = "select a.id_penjualan, a.tanggal, "
+"b.judul, b.penulis, b.harga_jual, a.jumlah "
+"from tbl_kasir c inner join (tbl_buku b inner join tbl_penjualan a on b.id_buku = a.id_buku)"
+ "on c.id_kasir = a.id_kasir";
ResultSet rs = classkoneksi.executeQuery(SQL);
while(rs.next()){
table.addRow(new Object[]{
rs.getString(1),
rs.getString(2),
rs.getString(3),
rs.getString(4),
rs.getString(5),
rs.getString(6)
});
}
}catch(SQLException ex) {
Logger.getLogger(classkoneksi.class.getName()).log(Level.SEVERE, null, ex);
System.out.println(ex);
}
tblData.setModel(table);
}
private void getDataForUpdate(){
try{
int i = tblData.getSelectedRow();
String id = tblData.getValueAt(i, 0).toString();
Penjualan pj = new Penjualan();
pj.setIdPenjualan(id);
pj.setUpdate(true);
pj.setVisible(true);
}catch(Exception e){
JOptionPane.showMessageDialog(rootPane, "Silahkan pilih data untuk di ubah.");
}
}
private void deleteData(){
try {
int i = tblData.getSelectedRow();
String idTransaksi = tblData.getValueAt(i, 0).toString();
if(JOptionPane.showConfirmDialog(rootPane, "Apakah Anda Yakin?\nMenghapus Data "+idTransaksi+"","Informasi",
JOptionPane.CANCEL_OPTION,JOptionPane.INFORMATION_MESSAGE)==JOptionPane.OK_OPTION){
String SQL = "delete from tbl_penjualan where id_penjualan = '"+idTransaksi+"'";
int a = classkoneksi.execute(SQL);
if(a>0){
JOptionPane.showMessageDialog(rootPane, "Data Berhasil Dihapus.","Success",JOptionPane.INFORMATION_MESSAGE);
selectData();
}else{
JOptionPane.showMessageDialog(rootPane, "Data Gagal Dihapus.","Gagal",JOptionPane.WARNING_MESSAGE);
}
}
} catch (Exception e) {
}
}
private void cari(){
DefaultTableModel table = new DefaultTableModel();
table.addColumn("id_penjualan");
table.addColumn("tanggal");
table.addColumn("judul");
table.addColumn("harga_jual");
table.addColumn("diskon");
table.addColumn("jumlah");
table.addColumn("total");
String keyword = txtCari.getText();
try{
String SQL = "SELECT a.id_penjualan, a.tanggal, "
+ "b.judul, b.harga_jual, b.diskon, a.jumlah, a.total "
+ "FROM tbl_kasir c INNER JOIN (tbl_buku b INNER JOIN tbl_penjualan a on b.id_buku = a.id_buku) "
+ "on c.id_kasir = a.id_kasir "
+ "where id_penjualan like '%"+keyword+"%' or tanggal like '%"+keyword+"%' or "
+ "judul like '%"+keyword+"%' or harga_jual like '%"+keyword+"%' or "
+ "diskon like '%"+keyword+"%' or jumlah like '%"+keyword+"%' or "
+ "total like '%"+keyword+"%'";
ResultSet rs = classkoneksi.executeQuery(SQL);
while(rs.next()){
table.addRow(new Object[]{
rs.getString(1),
rs.getString(2),
rs.getString(3),
rs.getString(4),
rs.getString(5),
rs.getString(6),
rs.getString(7)
});
}
}catch(Exception e){
System.out.println();
}
tblData.setModel(table);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
tblData = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
txtCari = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 153)), "Daftar Penjualan"));
tblData.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane1.setViewportView(tblData);
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900013_icons_add.png"))); // NOI18N
jButton1.setText("BARU");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900340_delete.png"))); // NOI18N
jButton3.setText("HAPUS");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900315_sync.png"))); // NOI18N
jButton4.setText("REFRESH");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900317_common-logout-signout-exit-glyph.png"))); // NOI18N
jButton5.setText("KELUAR");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/edit.png"))); // NOI18N
jButton6.setText("RUBAH");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
jLabel1.setText("CARI");
txtCari.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtCariActionPerformed(evt);
}
});
txtCari.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtCariKeyReleased(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton5)
.addGap(4, 4, 4))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton4))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(19, 19, 19)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtCari, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 594, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(22, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(21, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtCari, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(29, 29, 29)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton3)
.addComponent(jButton4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton6)
.addComponent(jButton5))
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>
private void txtCariActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void txtCariKeyReleased(java.awt.event.KeyEvent evt) {
// TODO add your handling code here:
cari();
}
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.dispose();
}
private void formWindowOpened(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
selectData();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Penjualan ds = new Penjualan();
ds.setVisible(true);
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
selectData();
}
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
getDataForUpdate();
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
deleteData();
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(DaftarPenjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(DaftarPenjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(DaftarPenjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(DaftarPenjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new DaftarPenjualan().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable tblData;
private javax.swing.JTextField txtCari;
// End of variables declaration
}
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package nmTransaksi;
import Class.classkoneksi;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JRootPane;
import javax.swing.table.DefaultTableModel;
/**
*
* @author RPL
*/
public class DaftarPenjualan extends javax.swing.JFrame {
/**
* Creates new form DaftarPenjualan
*/
public DaftarPenjualan() {
setUndecorated(true);
getRootPane().setWindowDecorationStyle(JRootPane.NONE);
initComponents();
this.setLocationRelativeTo(this);
}
public void selectData(){
DefaultTableModel table = new DefaultTableModel();
table.addColumn("Id Penjualan");
table.addColumn("Tanggal");
table.addColumn("Judul");
table.addColumn("Penulis");
table.addColumn("Harga Jual");
table.addColumn("Jumlah");
try{
String SQL = "select a.id_penjualan, a.tanggal, "
+"b.judul, b.penulis, b.harga_jual, a.jumlah "
+"from tbl_kasir c inner join (tbl_buku b inner join tbl_penjualan a on b.id_buku = a.id_buku)"
+ "on c.id_kasir = a.id_kasir";
ResultSet rs = classkoneksi.executeQuery(SQL);
while(rs.next()){
table.addRow(new Object[]{
rs.getString(1),
rs.getString(2),
rs.getString(3),
rs.getString(4),
rs.getString(5),
rs.getString(6)
});
}
}catch(SQLException ex) {
Logger.getLogger(classkoneksi.class.getName()).log(Level.SEVERE, null, ex);
System.out.println(ex);
}
tblData.setModel(table);
}
private void getDataForUpdate(){
try{
int i = tblData.getSelectedRow();
String id = tblData.getValueAt(i, 0).toString();
Penjualan pj = new Penjualan();
pj.setIdPenjualan(id);
pj.setUpdate(true);
pj.setVisible(true);
}catch(Exception e){
JOptionPane.showMessageDialog(rootPane, "Silahkan pilih data untuk di ubah.");
}
}
private void deleteData(){
try {
int i = tblData.getSelectedRow();
String idTransaksi = tblData.getValueAt(i, 0).toString();
if(JOptionPane.showConfirmDialog(rootPane, "Apakah Anda Yakin?\nMenghapus Data "+idTransaksi+"","Informasi",
JOptionPane.CANCEL_OPTION,JOptionPane.INFORMATION_MESSAGE)==JOptionPane.OK_OPTION){
String SQL = "delete from tbl_penjualan where id_penjualan = '"+idTransaksi+"'";
int a = classkoneksi.execute(SQL);
if(a>0){
JOptionPane.showMessageDialog(rootPane, "Data Berhasil Dihapus.","Success",JOptionPane.INFORMATION_MESSAGE);
selectData();
}else{
JOptionPane.showMessageDialog(rootPane, "Data Gagal Dihapus.","Gagal",JOptionPane.WARNING_MESSAGE);
}
}
} catch (Exception e) {
}
}
private void cari(){
DefaultTableModel table = new DefaultTableModel();
table.addColumn("id_penjualan");
table.addColumn("tanggal");
table.addColumn("judul");
table.addColumn("harga_jual");
table.addColumn("diskon");
table.addColumn("jumlah");
table.addColumn("total");
String keyword = txtCari.getText();
try{
String SQL = "SELECT a.id_penjualan, a.tanggal, "
+ "b.judul, b.harga_jual, b.diskon, a.jumlah, a.total "
+ "FROM tbl_kasir c INNER JOIN (tbl_buku b INNER JOIN tbl_penjualan a on b.id_buku = a.id_buku) "
+ "on c.id_kasir = a.id_kasir "
+ "where id_penjualan like '%"+keyword+"%' or tanggal like '%"+keyword+"%' or "
+ "judul like '%"+keyword+"%' or harga_jual like '%"+keyword+"%' or "
+ "diskon like '%"+keyword+"%' or jumlah like '%"+keyword+"%' or "
+ "total like '%"+keyword+"%'";
ResultSet rs = classkoneksi.executeQuery(SQL);
while(rs.next()){
table.addRow(new Object[]{
rs.getString(1),
rs.getString(2),
rs.getString(3),
rs.getString(4),
rs.getString(5),
rs.getString(6),
rs.getString(7)
});
}
}catch(Exception e){
System.out.println();
}
tblData.setModel(table);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
tblData = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
txtCari = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 153)), "Daftar Penjualan"));
tblData.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane1.setViewportView(tblData);
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900013_icons_add.png"))); // NOI18N
jButton1.setText("BARU");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900340_delete.png"))); // NOI18N
jButton3.setText("HAPUS");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900315_sync.png"))); // NOI18N
jButton4.setText("REFRESH");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/1484900317_common-logout-signout-exit-glyph.png"))); // NOI18N
jButton5.setText("KELUAR");
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gambar/edit.png"))); // NOI18N
jButton6.setText("RUBAH");
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
jLabel1.setText("CARI");
txtCari.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtCariActionPerformed(evt);
}
});
txtCari.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
txtCariKeyReleased(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton5)
.addGap(4, 4, 4))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton4))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(19, 19, 19)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtCari, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 594, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(22, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(21, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtCari, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(29, 29, 29)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton3)
.addComponent(jButton4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton6)
.addComponent(jButton5))
.addContainerGap())
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>
private void txtCariActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void txtCariKeyReleased(java.awt.event.KeyEvent evt) {
// TODO add your handling code here:
cari();
}
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
this.dispose();
}
private void formWindowOpened(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
selectData();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Penjualan ds = new Penjualan();
ds.setVisible(true);
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
selectData();
}
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
getDataForUpdate();
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
deleteData();
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(DaftarPenjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(DaftarPenjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(DaftarPenjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(DaftarPenjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new DaftarPenjualan().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable tblData;
private javax.swing.JTextField txtCari;
// End of variables declaration
}
Comments
Post a Comment