View.FormAnggota.java Source code

Java tutorial

Introduction

Here is the source code for View.FormAnggota.java

Source

/*
 * 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 View;

import Custom.FormatRibuan;
import Custom.Tanggal;
import Kelas.Anggota;
import Kelas.Konfigurasi;
import Kelas.Pemakaian;
import Kelas.Profil;
import Kelas.Trans;
import Kelas.Transaksi;
import Koneksi.Koneksi;
import Kontrol.AnggotaKontrol;
import Kontrol.KonfigurasiKontrol;
import Kontrol.PemakaianKontrol;
import Kontrol.PengaturanKontrol;
import Kontrol.TransKontrol;
import Kontrol.TransaksiKontrol;
import TabelModel.AnggotaTM;
import TabelModel.DusunTM;
import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.view.JasperViewer;
import org.apache.commons.io.FileUtils;

/**
 *
 * @author damaikurnia
 */
public class FormAnggota extends javax.swing.JFrame {

    Konfigurasi konfig;
    List<Anggota> dusun;
    Profil prof;
    File file;

    /**
     * Creates new form FormAir
     */
    public FormAnggota() {
        initComponents();
        this.setLocationRelativeTo(null);
        try {
            //        setExtendedState(this.getExtendedState() | JFrame.MAXIMIZED_BOTH);
            konfig = KonfigurasiKontrol.getKoneksi().selectKonfigurasi();
            dusun = AnggotaKontrol.getKoneksi().selectDusun();
            prof = PengaturanKontrol.getKoneksi().tampilProfil();
            jLabel4.setText("BIAYA REGISTRASI = Rp " + konfig.getRegistrasi());
        } catch (SQLException ex) {
            Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
        }

        SinkronDusun();
        sinkronGambar();
        SinkronAlamat();
        dialog_anggota.setVisible(false);
        dialog_anggota.setSize(627, 365);
        dialog_anggota.setLocationRelativeTo(null);
        dialog_anggota.setTitle("DATA ANGGOTA");
        //        label_namaFile.setVisible(false);

        dialog_dusun.setVisible(false);
        dialog_dusun.setSize(400, 300);
        dialog_dusun.setLocationRelativeTo(null);
        dialog_dusun.setTitle("DATA DUSUN");
    }

    /**
     * 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">//GEN-BEGIN:initComponents
    private void initComponents() {

        dialog_anggota = new javax.swing.JDialog();
        jPanel10 = new javax.swing.JPanel();
        jPanel11 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tabel_anggota = new javax.swing.JTable();
        button_cetak = new javax.swing.JButton();
        dialog_dusun = new javax.swing.JDialog();
        jPanel4 = new javax.swing.JPanel();
        jPanel5 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        text_addDusun = new javax.swing.JTextField();
        button_tambahDusun = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tabel_dusun = new javax.swing.JTable();
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        label_namaDesa = new javax.swing.JLabel();
        label_alamatNotelp = new javax.swing.JLabel();
        label_kop = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        button_ubah = new javax.swing.JButton();
        button_tambah = new javax.swing.JButton();
        button_hapus = new javax.swing.JButton();
        button_tabel = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        text_ktp = new javax.swing.JTextField();
        text_idAnggota = new javax.swing.JTextField();
        text_nama = new javax.swing.JTextField();
        text_pekerjaan = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        text_alamat = new javax.swing.JTextArea();
        jLabel10 = new javax.swing.JLabel();
        text_telp = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        text_provinsi = new javax.swing.JTextField();
        text_rw = new javax.swing.JTextField();
        text_desa = new javax.swing.JTextField();
        text_kota = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        text_rt = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        text_kecamatan = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        text_biaya = new javax.swing.JTextField();
        button_batal = new javax.swing.JButton();
        label_Gambar = new javax.swing.JLabel();
        button_upload = new javax.swing.JButton();
        label_namaFile = new javax.swing.JLabel();
        button_cetakNota = new javax.swing.JButton();
        combo_dusun = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();
        jMenuItem13 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMenuItem9 = new javax.swing.JMenuItem();
        jMenuItem10 = new javax.swing.JMenuItem();
        jMenuItem11 = new javax.swing.JMenuItem();
        jMenuItem7 = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem6 = new javax.swing.JMenuItem();
        jMenu5 = new javax.swing.JMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem12 = new javax.swing.JMenuItem();
        jMenu6 = new javax.swing.JMenu();
        jMenuItem14 = new javax.swing.JMenuItem();
        jMenuItem8 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();

        dialog_anggota.getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel10.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel10.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel11.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("TABEL ANGGOTA");

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
                jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                        javax.swing.GroupLayout.Alignment.TRAILING,
                        jPanel11Layout.createSequentialGroup().addContainerGap()
                                .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 588, Short.MAX_VALUE)
                                .addContainerGap()));
        jPanel11Layout.setVerticalGroup(
                jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
                        javax.swing.GroupLayout.Alignment.TRAILING,
                        jPanel11Layout.createSequentialGroup().addContainerGap()
                                .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
                                .addContainerGap()));

        jPanel10.add(jPanel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 610, 80));

        tabel_anggota
                .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" }));
        tabel_anggota.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabel_anggotaMouseClicked(evt);
            }
        });
        jScrollPane3.setViewportView(tabel_anggota);

        jPanel10.add(jScrollPane3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 100, 590, 200));

        button_cetak.setText("CETAK DAFTAR ANGGOTA");
        button_cetak.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_cetakActionPerformed(evt);
            }
        });
        jPanel10.add(button_cetak, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 310, -1, -1));

        dialog_anggota.getContentPane().add(jPanel10,
                new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 610, 350));

        jPanel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jPanel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel3.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("TAMBAH DUSUN");

        button_tambahDusun.setText("+");
        button_tambahDusun.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_tambahDusunActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(jPanel5Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE)
                                .addGroup(jPanel5Layout.createSequentialGroup().addComponent(text_addDusun)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(button_tambahDusun)))
                        .addContainerGap()));
        jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap()
                        .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(text_addDusun, javax.swing.GroupLayout.PREFERRED_SIZE, 25,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(button_tambahDusun))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        jPanel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        tabel_dusun
                .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" }));
        jScrollPane2.setViewportView(tabel_dusun);

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(jPanel6Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                        .addContainerGap()));
        jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE)
                        .addContainerGap()));

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(jPanel4Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel6,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)));

        javax.swing.GroupLayout dialog_dusunLayout = new javax.swing.GroupLayout(dialog_dusun.getContentPane());
        dialog_dusun.getContentPane().setLayout(dialog_dusunLayout);
        dialog_dusunLayout.setHorizontalGroup(
                dialog_dusunLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
                        jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        dialog_dusunLayout
                .setVerticalGroup(dialog_dusunLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel2.setBackground(new java.awt.Color(153, 153, 255));
        jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabel1.setText("SISTEM INFORMASI PENGELOLAAN AIR BERSIH");

        label_namaDesa.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        label_namaDesa.setText("BADAN USAHA MILIK DESA <<NAMA DESA>>");

        label_alamatNotelp.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        label_alamatNotelp.setText("<<ALAMAT, NO TELP>>");

        label_kop.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout
                .setHorizontalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                                .addComponent(label_kop, javax.swing.GroupLayout.PREFERRED_SIZE, 111,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel2Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(label_namaDesa, javax.swing.GroupLayout.Alignment.TRAILING,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(label_alamatNotelp, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                730, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addContainerGap(42, Short.MAX_VALUE)));
        jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(label_kop, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 31,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(label_namaDesa, javax.swing.GroupLayout.PREFERRED_SIZE, 19,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(label_alamatNotelp).addContainerGap(17, Short.MAX_VALUE)));

        jPanel3.setBackground(new java.awt.Color(255, 255, 255));
        jPanel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel4.setText("BIAYA REGISTRASI = Rp 50000");

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel5.setText("FORM PELANGGAN BARU");

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel6.setText("NO PELANGGAN");

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel7.setText("NAMA PELANGGAN");

        button_ubah.setText("UBAH");
        button_ubah.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_ubahActionPerformed(evt);
            }
        });

        button_tambah.setText("TAMBAH PELANGGAN");
        button_tambah.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_tambahActionPerformed(evt);
            }
        });

        button_hapus.setText("HAPUS");
        button_hapus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_hapusActionPerformed(evt);
            }
        });

        button_tabel.setText("DAFTAR SELURUH PELANGGAN");
        button_tabel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_tabelActionPerformed(evt);
            }
        });

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel8.setText("PEKERJAAN");

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel9.setText("ALAMAT");

        text_idAnggota.setEditable(false);

        text_nama.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                text_namaActionPerformed(evt);
            }
        });

        text_alamat.setColumns(20);
        text_alamat.setRows(5);
        jScrollPane1.setViewportView(text_alamat);

        jLabel10.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel10.setText("PROVINSI");

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel11.setText("TELP");

        jLabel12.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel12.setText("DUSUN");

        jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel13.setText("/");

        jLabel14.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel14.setText("KECAMATAN");

        jLabel15.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel15.setText("KOTA / KAB");

        jLabel16.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel16.setText("RT/RW");

        jLabel17.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel17.setText("KEL / DESA");

        jLabel18.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel18.setText("TOTAL BIAYA");

        jLabel19.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel19.setText("NO KTP");

        text_biaya.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        text_biaya.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                text_biayaKeyReleased(evt);
            }
        });

        button_batal.setText("BATAL");
        button_batal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_batalActionPerformed(evt);
            }
        });

        label_Gambar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        button_upload.setText("UPLOAD");
        button_upload.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_uploadActionPerformed(evt);
            }
        });

        label_namaFile.setText("jLabel20");

        button_cetakNota.setText("CETAK NOTA ");
        button_cetakNota.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_cetakNotaActionPerformed(evt);
            }
        });

        combo_dusun.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                combo_dusunActionPerformed(evt);
            }
        });

        jButton1.setText("+");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(jPanel3Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout
                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel3Layout.createSequentialGroup().addGap(19, 19, 19).addGroup(jPanel3Layout
                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jLabel9)
                                                .addGroup(jPanel3Layout.createSequentialGroup()
                                                        .addGroup(jPanel3Layout.createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                                .addComponent(jLabel12).addComponent(jLabel16))
                                                        .addGap(90, 90, 90)
                                                        .addGroup(jPanel3Layout
                                                                .createParallelGroup(
                                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                                .addGroup(jPanel3Layout.createSequentialGroup()
                                                                        .addComponent(combo_dusun,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                151,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(
                                                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jButton1))
                                                                .addGroup(jPanel3Layout.createSequentialGroup()
                                                                        .addComponent(text_rt,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                60,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(
                                                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jLabel13).addGap(16, 16, 16)
                                                                        .addComponent(text_rw,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                60,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)))))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addGroup(jPanel3Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(jPanel3Layout.createSequentialGroup()
                                                                .addComponent(jLabel18)
                                                                .addPreferredGap(
                                                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(text_biaya,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE, 190,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addComponent(jLabel4,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE, 270,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addGroup(jPanel3Layout.createSequentialGroup()
                                                                .addGroup(jPanel3Layout.createParallelGroup(
                                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                                        .addGroup(jPanel3Layout
                                                                                .createSequentialGroup()
                                                                                .addGroup(jPanel3Layout
                                                                                        .createParallelGroup(
                                                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                                                false)
                                                                                        .addComponent(jLabel10,
                                                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                                Short.MAX_VALUE)
                                                                                        .addComponent(jLabel11,
                                                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                                Short.MAX_VALUE)
                                                                                        .addComponent(jLabel15,
                                                                                                javax.swing.GroupLayout.Alignment.LEADING,
                                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                                Short.MAX_VALUE)
                                                                                        .addComponent(jLabel17,
                                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                                Short.MAX_VALUE))
                                                                                .addGap(23, 23, 23))
                                                                        .addGroup(
                                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                                jPanel3Layout
                                                                                        .createSequentialGroup()
                                                                                        .addComponent(jLabel14)
                                                                                        .addGap(18, 18, 18)))
                                                                .addGroup(jPanel3Layout.createParallelGroup(
                                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                                        .addComponent(text_telp,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                190,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(text_provinsi,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                190,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(text_kota,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                190,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(text_desa,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                192,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(text_kecamatan,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                190,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE))))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                        false)
                                                .addGroup(jPanel3Layout.createSequentialGroup()
                                                        .addComponent(jLabel19)
                                                        .addPreferredGap(
                                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE)
                                                        .addComponent(text_ktp,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE, 190,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGroup(jPanel3Layout.createSequentialGroup()
                                                        .addGroup(jPanel3Layout
                                                                .createParallelGroup(
                                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                                .addComponent(jLabel6).addComponent(jLabel7)
                                                                .addComponent(jLabel8))
                                                        .addGroup(jPanel3Layout
                                                                .createParallelGroup(
                                                                        javax.swing.GroupLayout.Alignment.LEADING,
                                                                        false)
                                                                .addGroup(jPanel3Layout.createSequentialGroup()
                                                                        .addGap(25, 25, 25)
                                                                        .addGroup(jPanel3Layout.createParallelGroup(
                                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                                                .addComponent(text_idAnggota,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                        190,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                .addComponent(text_nama,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                        190,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                                .addGroup(
                                                                        javax.swing.GroupLayout.Alignment.TRAILING,
                                                                        jPanel3Layout.createSequentialGroup()
                                                                                .addPreferredGap(
                                                                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                        Short.MAX_VALUE)
                                                                                .addComponent(text_pekerjaan,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                        190,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE))))
                                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        190, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                                        .addGroup(jPanel3Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                .addComponent(button_upload, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        160, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(label_Gambar, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        160, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(label_namaFile,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE, 160,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(20, 20, 20))
                                .addGroup(jPanel3Layout.createSequentialGroup().addComponent(button_tambah)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(button_ubah)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(button_hapus)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(button_tabel)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(button_cetakNota)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(button_batal).addGap(0, 230, Short.MAX_VALUE))))
                        .addGroup(jPanel3Layout.createSequentialGroup().addGap(9, 9, 9).addComponent(jLabel5,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)))
                        .addContainerGap()));
        jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addComponent(jLabel5)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout
                                        .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(jPanel3Layout.createSequentialGroup()
                                                        .addGroup(jPanel3Layout
                                                                .createParallelGroup(
                                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                                .addGroup(jPanel3Layout.createSequentialGroup()
                                                                        .addComponent(jLabel6,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                20,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addGap(10, 10, 10).addComponent(jLabel7,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                20,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                .addGroup(jPanel3Layout.createSequentialGroup()
                                                                        .addGroup(jPanel3Layout.createParallelGroup(
                                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                                                .addComponent(text_idAnggota,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                                .addComponent(jLabel14,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                        20,
                                                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                                                        .addGap(10, 10, 10).addComponent(text_nama,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)))
                                                        .addPreferredGap(
                                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jLabel19,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE, 20,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                        jPanel3Layout.createSequentialGroup().addGap(57, 57, 57)
                                                                .addComponent(text_ktp,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addGap(1, 1, 1)))
                                                .addGroup(jPanel3Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                                jPanel3Layout.createSequentialGroup().addComponent(
                                                                        jLabel8,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE, 20,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(
                                                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jLabel9,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                40,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addPreferredGap(
                                                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                        .addComponent(jLabel16,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                20,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addGroup(jPanel3Layout.createSequentialGroup()
                                                                .addGap(11, 11, 11)
                                                                .addComponent(text_pekerjaan,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(
                                                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addComponent(jScrollPane1,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE, 40,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                .addPreferredGap(
                                                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                                .addGroup(jPanel3Layout.createParallelGroup(
                                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                                        .addComponent(text_rt,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(jLabel13,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                20,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(text_rw,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE))))
                                                .addGap(8, 8, 8)
                                                .addGroup(jPanel3Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                                                                jPanel3Layout.createParallelGroup(
                                                                        javax.swing.GroupLayout.Alignment.BASELINE)
                                                                        .addComponent(jLabel4,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                20,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(combo_dusun,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                                        .addComponent(jButton1))
                                                        .addComponent(jLabel12,
                                                                javax.swing.GroupLayout.Alignment.TRAILING,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE, 20,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel3Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel18,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE, 20,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(text_biaya,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)))
                                        .addGroup(jPanel3Layout.createSequentialGroup().addGap(3, 3, 3)
                                                .addComponent(text_kecamatan,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addGroup(jPanel3Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel17,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE, 20,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(text_desa,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel3Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel15,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE, 20,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(text_kota,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel3Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                                        .addComponent(jLabel10,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE, 20,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(text_provinsi,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGap(6, 6, 6)
                                                .addGroup(jPanel3Layout
                                                        .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addGroup(jPanel3Layout.createSequentialGroup()
                                                                .addGap(5, 5, 5).addComponent(jLabel11,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE, 20,
                                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addComponent(text_telp,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                javax.swing.GroupLayout.PREFERRED_SIZE))))
                                        .addGap(28, 28, 28)
                                        .addGroup(jPanel3Layout
                                                .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                .addComponent(button_tambah).addComponent(button_ubah)
                                                .addComponent(button_hapus).addComponent(button_tabel)
                                                .addComponent(button_cetakNota).addComponent(button_batal)))
                                .addGroup(jPanel3Layout.createSequentialGroup().addGap(3, 3, 3)
                                        .addComponent(label_namaFile)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(label_Gambar, javax.swing.GroupLayout.PREFERRED_SIZE, 200,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(button_upload)))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(jPanel1Layout
                .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE));
        jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jPanel3,
                                javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)));

        jMenu1.setBackground(java.awt.Color.black);
        jMenu1.setText("HOME");
        jMenu1.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N
        jMenu1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenu1MouseClicked(evt);
            }
        });
        jMenuBar1.add(jMenu1);

        jMenu2.setBackground(java.awt.Color.black);
        jMenu2.setText("BARANG");
        jMenu2.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N

        jMenuItem3.setBackground(java.awt.Color.white);
        jMenuItem3.setForeground(java.awt.Color.black);
        jMenuItem3.setText("Pembelian Barang");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem3ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem3);

        jMenuItem13.setBackground(java.awt.Color.white);
        jMenuItem13.setForeground(java.awt.Color.black);
        jMenuItem13.setText("Pemakaian Barang");
        jMenuItem13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem13ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem13);

        jMenuBar1.add(jMenu2);

        jMenu3.setBackground(java.awt.Color.black);
        jMenu3.setText("PELANGGAN");
        jMenu3.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N

        jMenuItem9.setBackground(java.awt.Color.white);
        jMenuItem9.setForeground(java.awt.Color.black);
        jMenuItem9.setText("Pendaftaran Pelanggan Baru");
        jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem9ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem9);

        jMenuItem10.setBackground(java.awt.Color.white);
        jMenuItem10.setForeground(java.awt.Color.black);
        jMenuItem10.setText("Pemakaian Air Pelanggan");
        jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem10ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem10);

        jMenuItem11.setBackground(java.awt.Color.white);
        jMenuItem11.setForeground(java.awt.Color.black);
        jMenuItem11.setText("Pembayaran Rekening Air");
        jMenuItem11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem11ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem11);

        jMenuItem7.setBackground(java.awt.Color.white);
        jMenuItem7.setForeground(java.awt.Color.black);
        jMenuItem7.setText("Informasi Keluhan Pelanggan");
        jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem7ActionPerformed(evt);
            }
        });
        jMenu3.add(jMenuItem7);

        jMenuBar1.add(jMenu3);

        jMenu4.setBackground(java.awt.Color.black);
        jMenu4.setText("PENGELUARAN");
        jMenu4.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N

        jMenuItem1.setBackground(java.awt.Color.white);
        jMenuItem1.setForeground(java.awt.Color.black);
        jMenuItem1.setText("List Pengeluaran");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu4.add(jMenuItem1);

        jMenuItem5.setBackground(java.awt.Color.white);
        jMenuItem5.setForeground(java.awt.Color.black);
        jMenuItem5.setText("Pengeluaran Bulanan");
        jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem5ActionPerformed(evt);
            }
        });
        jMenu4.add(jMenuItem5);

        jMenuItem6.setBackground(java.awt.Color.white);
        jMenuItem6.setForeground(java.awt.Color.black);
        jMenuItem6.setText("Pembayaran Hutang");
        jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem6ActionPerformed(evt);
            }
        });
        jMenu4.add(jMenuItem6);

        jMenuBar1.add(jMenu4);

        jMenu5.setBackground(java.awt.Color.black);
        jMenu5.setText("LAPORAN");
        jMenu5.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N

        jMenuItem4.setBackground(java.awt.Color.white);
        jMenuItem4.setForeground(java.awt.Color.black);
        jMenuItem4.setText("Laba - Rugi");
        jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem4ActionPerformed(evt);
            }
        });
        jMenu5.add(jMenuItem4);

        jMenuItem12.setBackground(java.awt.Color.white);
        jMenuItem12.setForeground(java.awt.Color.black);
        jMenuItem12.setText("Neraca");
        jMenuItem12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem12ActionPerformed(evt);
            }
        });
        jMenu5.add(jMenuItem12);

        jMenuBar1.add(jMenu5);

        jMenu6.setBackground(java.awt.Color.black);
        jMenu6.setText("PENGATURAN");
        jMenu6.setFont(new java.awt.Font("SansSerif", 1, 12)); // NOI18N

        jMenuItem14.setBackground(java.awt.Color.white);
        jMenuItem14.setForeground(java.awt.Color.black);
        jMenuItem14.setText("Investasi Awal");
        jMenuItem14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem14ActionPerformed(evt);
            }
        });
        jMenu6.add(jMenuItem14);

        jMenuItem8.setBackground(java.awt.Color.white);
        jMenuItem8.setForeground(java.awt.Color.black);
        jMenuItem8.setText("Profil Desa");
        jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem8ActionPerformed(evt);
            }
        });
        jMenu6.add(jMenuItem8);

        jMenuItem2.setBackground(java.awt.Color.white);
        jMenuItem2.setForeground(java.awt.Color.black);
        jMenuItem2.setText("Pengaturan Persentase Laba Bersih");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
            }
        });
        jMenu6.add(jMenuItem2);

        jMenuBar1.add(jMenu6);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().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)
                .addGroup(layout.createSequentialGroup().addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addGap(3, 3, 3)));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void button_tabelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_tabelActionPerformed
        update();
        dialog_anggota.setVisible(true);
    }//GEN-LAST:event_button_tabelActionPerformed

    private void button_tambahActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_tambahActionPerformed
        if (Double.parseDouble(text_biaya.getText()) < konfig.getRegistrasi()) {
            JOptionPane.showMessageDialog(null, "Pembayaran Kurang");
        } else {
            try {
                //konfigurasi simpan file dan rename file dlu
                String path = new File(".").getCanonicalPath();
                //            System.out.println(file + " " + path);
                FileUtils.copyFileToDirectory(file, new File(path + "/Gambar")); //copy file ke folder image
                file = new File(path + "/Gambar/" + label_namaFile.getText());//set lokasi file
                file.renameTo(new File(path + "/Gambar/" + text_idAnggota.getText() + "."
                        + label_namaFile.getText().split("\\.")[1]));//rename file dgn nim

                Anggota agt = new Anggota();
                agt.setIdAnggota(text_idAnggota.getText());
                agt.setNamaAnggota(text_nama.getText());
                agt.setPekerjaan(text_pekerjaan.getText());
                agt.setAlamat(text_alamat.getText());
                agt.setNoTelp(text_telp.getText());
                agt.setNoKTP(text_ktp.getText());
                agt.setRt(Integer.parseInt(text_rt.getText()));
                agt.setRw(Integer.parseInt(text_rw.getText()));
                agt.setDusun(combo_dusun.getSelectedItem().toString());
                agt.setDesa(text_desa.getText());
                agt.setKota(text_kota.getText());
                agt.setProvinsi(text_provinsi.getText());
                agt.setKecamatan(text_kecamatan.getText());
                agt.setLogo(text_idAnggota.getText() + "." + label_namaFile.getText().split("\\.")[1]);

                AnggotaKontrol.getKoneksi().insertAnggota(agt);//buat database anggota
                String tanggalBln = generateBulanTahun(Tanggal.getTanggal2());
                Pemakaian pem = new Pemakaian(generateKode(agt), agt, 0, 0, 0, tanggalBln.split("-")[0],
                        cariTanggalJatuhTempo());
                PemakaianKontrol.getKoneksi().insertPemakaian(pem);
                insertKeTransaksi(agt);

                //insertTransNeraca //pendapatan(debit), modal(debit), kas (debit)
                Trans t = new Trans("1.1.1", konfig.getRegistrasi(), 0);//kas
                TransKontrol.getKoneksi().insertTransaksi(t);
                t = new Trans("4.1.1", konfig.getRegistrasi(), 0);//pendapatan air
                TransKontrol.getKoneksi().insertTransaksi(t);

                JOptionPane.showMessageDialog(null, "Anggota berhasil ditambahkan!");
                resetdefault();
            } catch (SQLException ex) {
                Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_button_tambahActionPerformed

    private void button_ubahActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_ubahActionPerformed
        try {
            //konfigurasi simpan file dan rename file dlu
            String path = new File(".").getCanonicalPath();
            //            System.out.println(file + " " + path);
            Anggota prof = AnggotaKontrol.getKoneksi().selectAnggota(text_idAnggota.getText());
            FileUtils.copyFileToDirectory(file, new File(path + "/Gambar")); //copy file ke folder image
            File f = new File(path + "/Gambar/" + prof.getLogo());
            f.delete();
            file = new File(path + "/Gambar/" + label_namaFile.getText());//set lokasi file
            file.renameTo(new File(
                    path + "/Gambar/" + text_idAnggota.getText() + "." + label_namaFile.getText().split("\\.")[1]));//rename file dgn nim

            Anggota agt = new Anggota();
            agt.setIdAnggota(text_idAnggota.getText());
            agt.setNamaAnggota(text_nama.getText());
            agt.setPekerjaan(text_pekerjaan.getText());
            agt.setAlamat(text_alamat.getText());
            agt.setNoTelp(text_telp.getText());
            agt.setNoKTP(text_ktp.getText());
            agt.setRt(Integer.parseInt(text_rt.getText()));
            agt.setRw(Integer.parseInt(text_rw.getText()));
            agt.setDusun(combo_dusun.getSelectedItem().toString());
            agt.setDesa(text_desa.getText());
            agt.setKota(text_kota.getText());
            agt.setProvinsi(text_provinsi.getText());
            agt.setKecamatan(text_kecamatan.getText());
            agt.setLogo(text_idAnggota.getText() + "." + label_namaFile.getText().split("\\.")[1]);

            AnggotaKontrol.getKoneksi().updateAnggota(agt);
            JOptionPane.showMessageDialog(null, "Anggota berhasil dirubah!");
            resetdefault();
        } catch (SQLException ex) {
            Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_button_ubahActionPerformed

    private void button_hapusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_hapusActionPerformed
        try {
            Anggota agt = new Anggota();
            agt.setIdAnggota(text_idAnggota.getText());

            //konfigurasi simpan file dan rename file dlu
            String path = new File(".").getCanonicalPath();
            //            System.out.println(file + " " + path);
            Anggota prof = AnggotaKontrol.getKoneksi().selectAnggota(text_idAnggota.getText());
            File f = new File(path + "/Gambar/" + prof.getLogo());
            f.delete();

            AnggotaKontrol.getKoneksi().deleteAnggota(agt);
            JOptionPane.showMessageDialog(null, "Anggota berhasil dihapus!");
            resetdefault();
        } catch (SQLException ex) {
            Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_button_hapusActionPerformed

    private void tabel_anggotaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabel_anggotaMouseClicked
        try {
            custom();
            int row1 = tabel_anggota.getSelectedRow();
            text_idAnggota.setText(tabel_anggota.getValueAt(row1, 0).toString());
            Anggota agt = AnggotaKontrol.getKoneksi().cariIdAnggota(tabel_anggota.getValueAt(row1, 1).toString());
            text_nama.setText(agt.getNamaAnggota());
            text_pekerjaan.setText(agt.getPekerjaan());
            text_alamat.setText(agt.getAlamat());
            text_rt.setText(Integer.toString(agt.getRt()));
            text_rw.setText(Integer.toString(agt.getRw()));
            combo_dusun.setSelectedItem(agt.getDusun());
            text_desa.setText(agt.getDesa());
            text_kota.setText(agt.getKota());
            text_provinsi.setText(agt.getProvinsi());
            text_telp.setText(agt.getNoTelp());
            text_ktp.setText(agt.getNoKTP());
            text_kecamatan.setText(agt.getKecamatan());

            Anggota foto = AnggotaKontrol.getKoneksi().selectAnggota(agt.getIdAnggota());
            String path = new File(".").getCanonicalPath();
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            Image image = toolkit.getImage(path + "/Gambar/" + foto.getLogo());
            //            Image imagedResized = image.getScaledInstance(200, 250, Image.SCALE_DEFAULT);
            Image imagedResized = image.getScaledInstance(175, 250, Image.SCALE_DEFAULT);
            ImageIcon imageIcon = new ImageIcon(imagedResized);

            label_Gambar.setIcon(imageIcon);
            label_namaFile.setText(foto.getLogo());

            dialog_anggota.setVisible(false);
            text_biaya.setEditable(false);
        } catch (SQLException ex) {
            Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_tabel_anggotaMouseClicked

    private void button_cetakActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_cetakActionPerformed
        Connection kon = new Koneksi().getConnection();
        String reportSource = "./src/Lap/LapPelanggan.jasper";
        Map<String, Object> params = new HashMap<String, Object>();
        try {
            JasperPrint jasperPrint = JasperFillManager.fillReport(reportSource, params, kon);
            JasperViewer.viewReport(jasperPrint, false);
        } catch (JRException ex) {
            ex.printStackTrace();
        }
    }//GEN-LAST:event_button_cetakActionPerformed

    private void button_batalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_batalActionPerformed
        resetdefault();
    }//GEN-LAST:event_button_batalActionPerformed

    private void button_uploadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_uploadActionPerformed
        JFileChooser jfc = new JFileChooser();
        if (jfc.showOpenDialog(label_Gambar) == JFileChooser.APPROVE_OPTION) {

            Toolkit toolkit = Toolkit.getDefaultToolkit();
            Image image = toolkit.getImage(jfc.getSelectedFile().getAbsolutePath());
            Image imagedResized = image.getScaledInstance(175, 250, Image.SCALE_DEFAULT);
            ImageIcon imageIcon = new ImageIcon(imagedResized);

            label_Gambar.setIcon(imageIcon);
            label_namaFile.setText(jfc.getSelectedFile().getName());//nama file nya
            //            System.out.println("jLabelnamaFile : " + label_namaFile.getText());

            file = new File(jfc.getSelectedFile().getPath()); // file untuk dikopi
            //            System.out.println("file : " + file.getPath());
        }
    }//GEN-LAST:event_button_uploadActionPerformed

    private void button_cetakNotaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_cetakNotaActionPerformed
        if (text_idAnggota.getText().equals("")) {
            JOptionPane.showMessageDialog(null, "Anggota tidak ditemukan.");
        } else {
            Transaksi trs = new Transaksi();
            trs.setNoTrans(text_idAnggota.getText() + "-0");
            cetakKuitansi(trs);
        }
    }//GEN-LAST:event_button_cetakNotaActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        dialog_dusun.setVisible(true);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void button_tambahDusunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_tambahDusunActionPerformed

        Anggota agt = new Anggota();
        agt.setDusun(text_addDusun.getText().toUpperCase());
        dusun.add(agt);
        combo_dusun.addItem(agt.getDusun());
        DusunTM dtm = new DusunTM(dusun);
        tabel_dusun.setModel(dtm);
        JOptionPane.showMessageDialog(null, "Dusun Berhasil Ditambah");
    }//GEN-LAST:event_button_tambahDusunActionPerformed

    private void combo_dusunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_combo_dusunActionPerformed
        try {
            SinkronAlamat();
            String kodeDusub = combo_dusun.getSelectedItem().toString().substring(0, 3);
            List<Anggota> agt = AnggotaKontrol.getKoneksi()
                    .selectAnggotaPerDusun(combo_dusun.getSelectedItem().toString());
            String kodebaru = cariKodeAnggotaBaru(agt);
            if (kodebaru.equals("0")) {
                text_idAnggota.setText(combo_dusun.getSelectedItem().toString().substring(0, 3) + ".1");
            } else {
                if (button_tambah.isEnabled() == false) {
                } else {
                    text_idAnggota.setText(kodebaru);
                }
            }
        } catch (SQLException ex) {
            Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_combo_dusunActionPerformed

    private void text_namaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_text_namaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_text_namaActionPerformed

    private void jMenu1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenu1MouseClicked
        FormAir a = new FormAir();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenu1MouseClicked

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        FormBarang a = new FormBarang();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void jMenuItem13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem13ActionPerformed
        FormTransaksiPemakaianBarang a = new FormTransaksiPemakaianBarang();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem13ActionPerformed

    private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
        FormAnggota a = new FormAnggota();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem9ActionPerformed

    private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem10ActionPerformed
        FormPemakaianAir a = new FormPemakaianAir();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem10ActionPerformed

    private void jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem11ActionPerformed
        FormTransaksiPenjualan a = new FormTransaksiPenjualan();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem11ActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        FormKeluhan a = new FormKeluhan();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem7ActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        FormPengeluaran a = new FormPengeluaran();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
        FormTransaksiPengeluaran a = new FormTransaksiPengeluaran();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem5ActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        FormTransaksiPembayaranHutang a = new FormTransaksiPembayaranHutang();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        FormLabaRugi a = new FormLabaRugi();
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem4ActionPerformed

    private void jMenuItem12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem12ActionPerformed
        FormNeraca a = new FormNeraca();
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem12ActionPerformed

    private void jMenuItem14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem14ActionPerformed
        FormInvesAwal a = new FormInvesAwal();
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem14ActionPerformed

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
        FormPengaturan a = new FormPengaturan();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem8ActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        FormSHU a = new FormSHU();
        this.setVisible(false);
        a.setVisible(true);
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void text_biayaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_text_biayaKeyReleased
        text_biaya.setText(FormatRibuan.pisahRibuan(text_biaya.getText()));
    }//GEN-LAST:event_text_biayaKeyReleased

    public void resetdefault() {
        text_idAnggota.setText("");
        text_nama.setText("");
        text_pekerjaan.setText("");
        text_alamat.setText("");
        text_telp.setText("");
        text_ktp.setText("");
        text_rt.setText("");
        text_rw.setText("");
        combo_dusun.setSelectedIndex(0);
        text_desa.setText("");
        text_kota.setText("");
        text_provinsi.setText("");
        text_kecamatan.setText("");
        text_idAnggota.setEditable(true);
        button_tambah.setEnabled(true);
        button_ubah.setEnabled(false);
        button_hapus.setEnabled(false);
        text_biaya.setEditable(true);
        text_biaya.setText("");

        label_Gambar.setIcon(null);
        label_namaFile.setText("");
    }

    public void custom() {
        text_idAnggota.setEditable(false);
        button_tambah.setEnabled(false);
        button_ubah.setEnabled(true);
        button_hapus.setEnabled(true);
    }

    public void update() {
        try {
            List<Anggota> agt = AnggotaKontrol.getKoneksi().selectAnggota();
            AnggotaTM model = new AnggotaTM(agt);
            tabel_anggota.setModel(model);

            //        tabelDosen.getColumnModel().getColumn(0).setMinWidth(70);
            //        tabelDosen.getColumnModel().getColumn(0).setMaxWidth(70);
            //        tabelDosen.getColumnModel().getColumn(1).setMinWidth(220);
            //        tabelDosen.getColumnModel().getColumn(1).setMaxWidth(220);
            //            tabelDosen.setDefaultRenderer(Object.class, new renderWarnaWarni(Color.lightGray, Color.white));
        } catch (SQLException ex) {
            Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public String generateKode(Anggota agt) {
        return agt.getIdAnggota() + "-1";
    }

    public String generateBulanTahun(String tanggal) {
        if (tanggal.split("-")[1].equals("01")) {
            return "JANUARI-" + tanggal.split("-")[0];
        } else if (tanggal.split("-")[1].equals("02")) {
            return "FEBRUARI-" + tanggal.split("-")[0];
        } else if (tanggal.split("-")[1].equals("03")) {
            return "MARET-" + tanggal.split("-")[0];
        } else if (tanggal.split("-")[1].equals("04")) {
            return "APRIL-" + tanggal.split("-")[0];
        } else if (tanggal.split("-")[1].equals("05")) {
            return "MEI-" + tanggal.split("-")[0];
        } else if (tanggal.split("-")[1].equals("06")) {
            return "JUNI-" + tanggal.split("-")[0];
        } else if (tanggal.split("-")[1].equals("07")) {
            return "JULI-" + tanggal.split("-")[0];
        } else if (tanggal.split("-")[1].equals("08")) {
            return "AGUSTUS-" + tanggal.split("-")[0];
        } else if (tanggal.split("-")[1].equals("09")) {
            return "SEPTEMBER-" + tanggal.split("-")[0];
        } else if (tanggal.split("-")[1].equals("10")) {
            return "OKTOBER-" + tanggal.split("-")[0];
        } else if (tanggal.split("-")[1].equals("11")) {
            return "NOVEMBER-" + tanggal.split("-")[0];
        } else {
            return "DESEMBER-" + tanggal.split("-")[0];
        }
    }

    public void insertKeTransaksi(Anggota agt) {
        try {
            Konfigurasi konfig = KonfigurasiKontrol.getKoneksi().selectKonfigurasi();

            Transaksi trans = new Transaksi();
            trans.setNoTrans(agt.getIdAnggota() + "-0");
            trans.setIdAnggota(agt);
            trans.setHargaSatuan(konfig.getRegistrasi());
            trans.setTotal(konfig.getRegistrasi());

            TransaksiKontrol.getKoneksi().daftar_insertTransaksi(trans);
            cetakKuitansi(trans);
        } catch (SQLException ex) {
            Logger.getLogger(FormAnggota.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void cetakKuitansi(Transaksi agt) {
        Connection kon = null;
        Koneksi con = new Koneksi();
        kon = con.getConnection();
        //BUKTI PENDAFTARAN DAN INSTALASI SALURAN AIR BERSIH
        String reportSource = "./src/Lap/NotaBuktiPendaftaran.jasper";

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("noTrans", agt.getNoTrans());
        String alamat = text_alamat.getText() + " RT/RW " + text_rt.getText() + "/" + text_rw.getText() + " "
                + combo_dusun.getSelectedItem().toString() + " " + text_desa.getText();
        params.put("alamat", alamat);
        params.put("judulnya", "BUKTI PENDAFTARAN DAN INSTALASI SALURAN AIR BERSIH");
        try {
            JasperPrint jasperPrint = JasperFillManager.fillReport(reportSource, params, kon);
            JasperViewer.viewReport(jasperPrint, false);

        } catch (JRException ex) {
            ex.printStackTrace();
        }
    }

    public String cariTanggalJatuhTempo() {
        String tanggal = Tanggal.getTanggal2();//ambil tanggal sekarang
        String jatuhTempo = "";
        if (tanggal.split("-")[1].equals("12")) {//kalo bulan desember, jatuh tempo ke bln 1 thn selanjutnya
            String tgl = "10";
            String bulan = "01";
            int tahun = Integer.parseInt(tanggal.split("-")[0]);
            tahun = tahun + 1;
            jatuhTempo = Integer.toString(tahun) + "-" + bulan + "-" + tgl;
        } else {
            String tgl = "10";
            int bulan = Integer.parseInt(tanggal.split("-")[1]);
            String bln = "";
            if (bulan >= 9) {
                bulan = bulan + 1;
                bln = Integer.toString(bulan);
            } else {
                bulan = bulan + 1;
                bln = "0" + Integer.toString(bulan);
            }
            String tahun = tanggal.split("-")[0];
            jatuhTempo = tahun + "-" + bln + "-" + tgl;
        }
        return jatuhTempo;
    }

    public void sinkronGambar() {
        try {
            Profil prof = PengaturanKontrol.getKoneksi().tampilProfil();
            label_namaDesa.setText("BADAN USAHA MILIK DESA " + prof.getNamadesa());
            label_alamatNotelp.setText(prof.getAlamatdesa() + " " + prof.getDesa() + " " + prof.getKecamatan() + " "
                    + prof.getKabupaten() + " " + prof.getProvinsi() + " - " + prof.getNotelp());

            String path = new File(".").getCanonicalPath() + "/Gambar/" + prof.getLogo();

            Toolkit toolkit = Toolkit.getDefaultToolkit();
            Image image = toolkit.getImage(path);
            Image imagedResized = image.getScaledInstance(110, 100, Image.SCALE_DEFAULT);
            ImageIcon imageIcon = new ImageIcon(imagedResized);
            label_kop.setIcon(imageIcon);
        } catch (IOException ex) {
            Logger.getLogger(FormPengaturan.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(FormPengaturan.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void SinkronDusun() {
        for (Anggota d : dusun) {
            combo_dusun.addItem(d.getDusun());
        }

        DusunTM model = new DusunTM(dusun);
        tabel_dusun.setModel(model);
    }

    public void SinkronAlamat() {
        text_kecamatan.setText(prof.getKecamatan());
        text_desa.setText(prof.getDesa());
        text_kota.setText(prof.getKabupaten());
        text_provinsi.setText(prof.getProvinsi());
    }

    public String cariKodeAnggotaBaru(List<Anggota> agt) {
        if (agt.size() == 0) {
            return "0";
        } else {
            int terbesar = 0;
            for (int i = 0; i < agt.size(); i++) {
                if (Integer.parseInt(agt.get(i).getIdAnggota().split("\\.")[1]) > terbesar) {
                    terbesar = Integer.parseInt(agt.get(i).getIdAnggota().split("\\.")[1]);
                } else {
                    terbesar = terbesar;
                }
            }
            terbesar++;
            return agt.get(0).getIdAnggota().split("\\.")[0] + "." + Integer.toString(terbesar);
        }
    }

    /**
     * @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(FormAnggota.class.getName()).log(java.util.logging.Level.SEVERE,
                    null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FormAnggota.class.getName()).log(java.util.logging.Level.SEVERE,
                    null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FormAnggota.class.getName()).log(java.util.logging.Level.SEVERE,
                    null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FormAnggota.class.getName()).log(java.util.logging.Level.SEVERE,
                    null, ex);
        }
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FormAnggota().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton button_batal;
    private javax.swing.JButton button_cetak;
    private javax.swing.JButton button_cetakNota;
    private javax.swing.JButton button_hapus;
    private javax.swing.JButton button_tabel;
    private javax.swing.JButton button_tambah;
    private javax.swing.JButton button_tambahDusun;
    private javax.swing.JButton button_ubah;
    private javax.swing.JButton button_upload;
    private javax.swing.JComboBox combo_dusun;
    private javax.swing.JDialog dialog_anggota;
    private javax.swing.JDialog dialog_dusun;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    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.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem11;
    private javax.swing.JMenuItem jMenuItem12;
    private javax.swing.JMenuItem jMenuItem13;
    private javax.swing.JMenuItem jMenuItem14;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JLabel label_Gambar;
    private javax.swing.JLabel label_alamatNotelp;
    private javax.swing.JLabel label_kop;
    private javax.swing.JLabel label_namaDesa;
    private javax.swing.JLabel label_namaFile;
    private javax.swing.JTable tabel_anggota;
    private javax.swing.JTable tabel_dusun;
    private javax.swing.JTextField text_addDusun;
    private javax.swing.JTextArea text_alamat;
    private javax.swing.JTextField text_biaya;
    private javax.swing.JTextField text_desa;
    private javax.swing.JTextField text_idAnggota;
    private javax.swing.JTextField text_kecamatan;
    private javax.swing.JTextField text_kota;
    private javax.swing.JTextField text_ktp;
    private javax.swing.JTextField text_nama;
    private javax.swing.JTextField text_pekerjaan;
    private javax.swing.JTextField text_provinsi;
    private javax.swing.JTextField text_rt;
    private javax.swing.JTextField text_rw;
    private javax.swing.JTextField text_telp;
    // End of variables declaration//GEN-END:variables
}