package id.keda87.clickrental.view.sub;
import com.toedter.calendar.JDateChooser;
import id.keda87.clickrental.controller.ControllerTransaksi;
import javax.swing.JTable;
import javax.swing.JTextField;
public class SubPengembalian extends javax.swing.JPanel {
private ControllerTransaksi ctk;
public SubPengembalian() {
initComponents();
ctk = new ControllerTransaksi(this);
ctk.isiTablePengembalian();
}
public JTable getTabel_pengembalian() {
return tabel_pengembalian;
}
public JTextField getTfbayardenda() {
return tfbayardenda;
}
public JTextField getTfkembalian() {
return tfkembalian;
}
public JTextField getTfketerlambatan() {
return tfketerlambatan;
}
public JDateChooser getTftanggalkembali() {
return tftanggalkembali;
}
public JTextField getTftotaldenda() {
return tftotaldenda;
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
tabel_pengembalian = new javax.swing.JTable();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
tftanggalkembali = new com.toedter.calendar.JDateChooser();
tfketerlambatan = new javax.swing.JTextField();
tftotaldenda = new javax.swing.JTextField();
tfbayardenda = new javax.swing.JTextField();
tfkembalian = new javax.swing.JTextField();
butHitungKeterlambatan = new javax.swing.JButton();
butBayarDenda = new javax.swing.JButton();
butSegar = new javax.swing.JButton();
jLabel1.setFont(new java.awt.Font("Century Gothic", 0, 18)); // NOI18N
jLabel1.setText("Menu Transaksi Pengembalian");
tabel_pengembalian.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(tabel_pengembalian);
jLabel2.setText("Tanggal Pengembalian");
jLabel3.setText("Total Keterlambatan");
jLabel4.setText("Total Denda");
jLabel5.setText("Bayar");
jLabel6.setText("Kembalian");
butHitungKeterlambatan.setText("Hitung Keterlambatan");
butHitungKeterlambatan.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
butHitungKeterlambatanActionPerformed(evt);
}
});
butBayarDenda.setText("Bayar Denda");
butBayarDenda.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
butBayarDendaActionPerformed(evt);
}
});
butSegar.setText("Segarkan");
butSegar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
butSegarActionPerformed(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()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 773, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(tfketerlambatan)
.addComponent(tftotaldenda)
.addComponent(tfbayardenda)
.addComponent(tfkembalian, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(butSegar, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(butBayarDenda, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(6, 6, 6)
.addComponent(tftanggalkembali, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(butHitungKeterlambatan, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(tftanggalkembali, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(butHitungKeterlambatan, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(tfketerlambatan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(tftotaldenda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(tfbayardenda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(butBayarDenda))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(tfkembalian, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(butSegar))
.addContainerGap())
);
jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {butBayarDenda, butHitungKeterlambatan, butSegar});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
}// </editor-fold>//GEN-END:initComponents
private void butSegarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butSegarActionPerformed
ctk.isiTablePengembalian();
ctk.kosongkanFormPengembalian();
}//GEN-LAST:event_butSegarActionPerformed
private void butHitungKeterlambatanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butHitungKeterlambatanActionPerformed
int row = tabel_pengembalian.getSelectedRow();
ctk.pengembalian(row);
}//GEN-LAST:event_butHitungKeterlambatanActionPerformed
private void butBayarDendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_butBayarDendaActionPerformed
ctk.hitungPembayaranDenda();
ctk.isiTablePengembalian();
}//GEN-LAST:event_butBayarDendaActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton butBayarDenda;
private javax.swing.JButton butHitungKeterlambatan;
private javax.swing.JButton butSegar;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable tabel_pengembalian;
private javax.swing.JTextField tfbayardenda;
private javax.swing.JTextField tfkembalian;
private javax.swing.JTextField tfketerlambatan;
private com.toedter.calendar.JDateChooser tftanggalkembali;
private javax.swing.JTextField tftotaldenda;
// End of variables declaration//GEN-END:variables
}