merangkai data pada grid panel

Merangkai data pada tabel grid, script di bawah ini contoh untuk membuat database di plot pada grids baris dan kolom Panel. (contoh script analisa program koperasi simpan pinjam)

 

import java.lang.*;

import javax.swing.*;

import java.awt.*;

import javax.swing.table.*;

import java.sql.*;

import java.awt.event.*;

import javax.swing.text.*;

import java.util.*;

 

public class data_analisabulan extends JInternalFrame {

// Deklarasi Komponen

JLabel jLabel1 = new JLabel();

JLabel jLabel2 = new JLabel();

JLabel jLabel3 = new JLabel();

JLabel jLabel4 = new JLabel();

JLabel jLabel5 = new JLabel();

JLabel jLabel6 = new JLabel();

 

JLabel jLabel7 = new JLabel();

JLabel jLabel8 = new JLabel();

JLabel jLabel9 = new JLabel();

JLabel jLabel10 = new JLabel();

JLabel jLabel11 = new JLabel();

JLabel jLabel12 = new JLabel();

JLabel jLabel13 = new JLabel();

JLabel jLabel14 = new JLabel();

JLabel jLabel15 = new JLabel();

JLabel jLabel16 = new JLabel();

 

JLabel jLabel17 = new JLabel();

JLabel jLabel18 = new JLabel();

JLabel jLabel19 = new JLabel();

 

JTextField dataKode = new JTextField();

JTextField data_total = new JTextField();

JTextField data_total1 = new JTextField();

JTextField data_total2 = new JTextField();

JTextField data_total3 = new JTextField();

JTextField data_total4 = new JTextField();

JComboBox data_thnx = new JComboBox();

 

JTextField Totalx01 = new JTextField();

JTextField Totalx02 = new JTextField();

JTextField Totalx03 = new JTextField();

JTextField Totalx04 = new JTextField();

JTextField Totalx05 = new JTextField();

JTextField Totalx06 = new JTextField();

JTextField Totalx07 = new JTextField();

JTextField Totalx08 = new JTextField();

JTextField Totalx09 = new JTextField();

JTextField Totalx10 = new JTextField();

 

JTextField Totalx11 = new JTextField();

JTextField Totalx12 = new JTextField();

JTextField Totalx13 = new JTextField();

 

JTabbedPane tabbedpane = new JTabbedPane();

 

JCheckBox cek1 = new JCheckBox();

 

JScrollPane jScrollPane1 = new JScrollPane();

JTable tabel = new JTable();

DefaultTableModel tabMode;

 

JScrollPane jScrollPane11 = new JScrollPane();

JTable tabel1 = new JTable();

DefaultTableModel tabMode1;

 

JScrollPane jScrollPane12 = new JScrollPane();

JTable tabel2 = new JTable();

DefaultTableModel tabMode2;

 

JScrollPane jScrollPane13 = new JScrollPane();

JTable tabel3 = new JTable();

DefaultTableModel tabMode3;

 

JScrollPane jScrollPane14 = new JScrollPane();

JTable tabel4 = new JTable();

DefaultTableModel tabMode4;

 

JScrollPane jScrollPane15 = new JScrollPane();

JTable tabel5 = new JTable();

DefaultTableModel tabMode5;

 

JScrollPane jScrollPane16 = new JScrollPane();

JTable tabel6 = new JTable();

DefaultTableModel tabMode6;

 

JScrollPane jScrollPane17 = new JScrollPane();

JTable tabel7 = new JTable();

DefaultTableModel tabMode7;

 

/**

* Konstuktor

* Methode ini berisikan pembuatan komponen dan penambahan Action Listener

*/

public data_analisabulan() {

this.setSize(820, 565);

this.setTitle(“Proses:Analisa Bulanan”);

this.setClosable(true);

this.getContentPane().setLayout(null);

this.setLocation(50, 50);

this.setResizable(false);

this.setVisible(true);

this.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 10));

 

jLabel1.setBounds(new Rectangle(15, 17, 300, 23));

jLabel1.setHorizontalAlignment(SwingConstants.LEFT);

jLabel1.setText(“Tahun Analisa :”);

jLabel1.setRequestFocusEnabled(true);

 

jLabel2.setBounds(new Rectangle(10, 10, 300, 23));

jLabel2.setHorizontalAlignment(SwingConstants.LEFT);

jLabel2.setText(“Transaksi :”);

jLabel2.setRequestFocusEnabled(true);

 

jLabel3.setBounds(new Rectangle(10, 10, 300, 23));

jLabel3.setHorizontalAlignment(SwingConstants.LEFT);

jLabel3.setText(“Transaksi :”);

jLabel3.setRequestFocusEnabled(true);

 

jLabel4.setBounds(new Rectangle(10, 10, 300, 23));

jLabel4.setHorizontalAlignment(SwingConstants.LEFT);

jLabel4.setText(“Transaksi :”);

jLabel4.setRequestFocusEnabled(true);

 

jLabel5.setBounds(new Rectangle(10, 10, 300, 23));

jLabel5.setHorizontalAlignment(SwingConstants.LEFT);

jLabel5.setText(“Kode Anggota :”);

jLabel5.setRequestFocusEnabled(true);

 

jLabel6.setBounds(new Rectangle(200, 10, 300, 23));

jLabel6.setHorizontalAlignment(SwingConstants.LEFT);

jLabel6.setText(“Nama :”);

jLabel6.setRequestFocusEnabled(true);

 

// =================================================

 

jLabel7.setBounds(new Rectangle(10, 250, 200, 23));

jLabel7.setHorizontalAlignment(SwingConstants.LEFT);

jLabel7.setText(“A.MODAL DASAR(01+02-05):”);

jLabel7.setRequestFocusEnabled(true);

 

jLabel8.setBounds(new Rectangle(10, 275, 200, 23));

jLabel8.setHorizontalAlignment(SwingConstants.LEFT);

jLabel8.setText(“B.LABA (X+08) :”);

jLabel8.setRequestFocusEnabled(true);

 

jLabel9.setBounds(new Rectangle(10, 300, 200, 23));

jLabel9.setHorizontalAlignment(SwingConstants.LEFT);

jLabel9.setText(“C.PEND.BUNGA BANK (07):”);

jLabel9.setRequestFocusEnabled(true);

 

jLabel10.setBounds(new Rectangle(10, 325, 200, 23));

jLabel10.setHorizontalAlignment(SwingConstants.LEFT);

jLabel10.setText(“D.PENGELUARAN(06+09+12):”);

jLabel10.setRequestFocusEnabled(true);

 

jLabel11.setBounds(new Rectangle(10, 350, 200, 23));

jLabel11.setHorizontalAlignment(SwingConstants.LEFT);

jLabel11.setText(“E.NET INCOME (B+C-D) :”);

jLabel11.setRequestFocusEnabled(true);

 

jLabel12.setBounds(new Rectangle(10, 375, 200, 23));

jLabel12.setHorizontalAlignment(SwingConstants.LEFT);

jLabel12.setText(“Piutang(AR) (03-04) :”);

jLabel12.setRequestFocusEnabled(true);

 

jLabel13.setBounds(new Rectangle(10, 400, 200, 23));

jLabel13.setHorizontalAlignment(SwingConstants.LEFT);

jLabel13.setText(“SAL.BANK(10-11-12+07) :”);

jLabel13.setRequestFocusEnabled(true);

 

jLabel14.setBounds(new Rectangle(380, 250, 200, 23));

jLabel14.setHorizontalAlignment(SwingConstants.LEFT);

jLabel14.setText(“I.Total Modal Dana Masuk :”);

jLabel14.setRequestFocusEnabled(true);

 

jLabel15.setBounds(new Rectangle(380, 275, 200, 23));

jLabel15.setHorizontalAlignment(SwingConstants.LEFT);

jLabel15.setText(“II.Total Dana Keluar :”);

jLabel15.setRequestFocusEnabled(true);

 

jLabel16.setBounds(new Rectangle(380, 300, 200, 23));

jLabel16.setHorizontalAlignment(SwingConstants.LEFT);

jLabel16.setText(“III.Jumlah Keuangan Total :”);

jLabel16.setRequestFocusEnabled(true);

 

// ===================================================

 

jLabel17.setBounds(new Rectangle(10, 270, 200, 23));

jLabel17.setHorizontalAlignment(SwingConstants.LEFT);

jLabel17.setText(“A.Tab Wajib + Iuran :”);

jLabel17.setRequestFocusEnabled(true);

 

jLabel18.setBounds(new Rectangle(10, 295, 200, 23));

jLabel18.setHorizontalAlignment(SwingConstants.LEFT);

jLabel18.setText(“B.Sisa Pinjaman :”);

jLabel18.setRequestFocusEnabled(true);

 

jLabel19.setBounds(new Rectangle(10, 320, 200, 23));

jLabel19.setHorizontalAlignment(SwingConstants.LEFT);

jLabel19.setText(“C.Netto (A-B) :”);

jLabel19.setRequestFocusEnabled(true);

 

 

dataKode.setBounds(new Rectangle(90, 10, 91, 22));

dataKode.setDocument(new batasiInput((byte) 5).getFilter());

dataKode.setToolTipText(“kode anggota…”);

 

data_total.setBounds(new Rectangle(676, 17, 120, 22));

data_total.setHorizontalAlignment(SwingConstants.RIGHT);

data_total.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

data_total.setToolTipText(“Total…”);

data_total.setEnabled(false);

 

data_total1.setBounds(new Rectangle(659, 10, 110, 22));

data_total1.setHorizontalAlignment(SwingConstants.RIGHT);

data_total1.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

data_total1.setToolTipText(“Total…”);

data_total1.setEnabled(false);

 

data_total2.setBounds(new Rectangle(659, 10, 110, 22));

data_total2.setHorizontalAlignment(SwingConstants.RIGHT);

data_total2.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

data_total2.setToolTipText(“Total…”);

data_total2.setEnabled(false);

 

data_total3.setBounds(new Rectangle(659, 10, 110, 22));

data_total3.setHorizontalAlignment(SwingConstants.RIGHT);

data_total3.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

data_total3.setToolTipText(“Total…”);

data_total3.setEnabled(false);

 

data_total4.setBounds(new Rectangle(659, 10, 110, 22));

data_total4.setHorizontalAlignment(SwingConstants.RIGHT);

data_total4.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

data_total4.setToolTipText(“Total…”);

data_total4.setEnabled(false);

 

// =================================================

Totalx01.setBounds(new Rectangle(225, 250, 125, 23));

Totalx01.setToolTipText(“Tabungan Wajib + Iuran Wajib…”);

Totalx01.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx01.setEnabled(false);

Totalx01.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

Totalx02.setBounds(new Rectangle(225, 275, 125, 23));

Totalx02.setToolTipText(“Laba (X+08)…”);

Totalx02.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx02.setEnabled(false);

Totalx02.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

Totalx03.setBounds(new Rectangle(225, 300, 125, 23));

Totalx03.setToolTipText(“Pendapatan Bunga (07)…”);

Totalx03.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx03.setEnabled(false);

Totalx03.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

Totalx04.setBounds(new Rectangle(225, 325, 125, 23));

Totalx04.setToolTipText(“Pengeluaran…”);

Totalx04.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx04.setEnabled(false);

Totalx04.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

Totalx05.setBounds(new Rectangle(225, 350, 125, 23));

Totalx05.setToolTipText(“Net Income…”);

Totalx05.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx05.setEnabled(false);

Totalx05.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

Totalx06.setBounds(new Rectangle(225, 375, 125, 23));

Totalx06.setToolTipText(“Piutang (AR)…”);

Totalx06.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx06.setEnabled(false);

Totalx06.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

Totalx07.setBounds(new Rectangle(225, 400, 125, 23));

Totalx07.setToolTipText(“Saldo Bank…”);

Totalx07.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx07.setEnabled(false);

Totalx07.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

Totalx08.setBounds(new Rectangle(540, 250, 125, 23));

Totalx08.setToolTipText(“Pokok Saldo & Pemasukan (A+B+C)…”);

Totalx08.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx08.setEnabled(false);

Totalx08.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

Totalx09.setBounds(new Rectangle(540, 275, 125, 23));

Totalx09.setToolTipText(“Pengeluaran Total (D)…”);

Totalx09.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx09.setEnabled(false);

Totalx09.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

Totalx10.setBounds(new Rectangle(540, 300, 125, 23));

Totalx10.setToolTipText(“Jumlah Keuangan Total …”);

Totalx10.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx10.setEnabled(false);

Totalx10.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

// ===================================================

 

Totalx11.setBounds(new Rectangle(185, 270, 125, 23));

Totalx11.setToolTipText(“Tabungan Wajib + Iuran Wajib…”);

Totalx11.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx11.setEnabled(false);

Totalx11.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

Totalx12.setBounds(new Rectangle(185, 295, 125, 23));

Totalx12.setToolTipText(“Sisa Pinjaman Anggota…”);

Totalx12.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx12.setEnabled(false);

Totalx12.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

Totalx13.setBounds(new Rectangle(185, 320, 125, 23));

Totalx13.setToolTipText(“Netto Tabungan Anggota…”);

Totalx13.setHorizontalAlignment(SwingConstants.RIGHT);

Totalx13.setEnabled(false);

Totalx13.setFont(new java.awt.Font(“Dialog”, Font.BOLD, 14));

 

 

data_thnx.setBounds(new Rectangle(105, 17, 70, 20));

Calendar dt = Calendar.getInstance();

for (int i = 2004; i <= (Calendar.getInstance().get(Calendar.YEAR)) + 5; i++) {

data_thnx.addItem(Integer.toString(i));

}

int nilai_bulan = dt.get(dt.MONTH);

int nilai_tahun = dt.get(dt.YEAR);

data_thnx.setSelectedItem(Integer.toString(nilai_tahun));

 

dataKode.addKeyListener(new KeyAdapter() {

public void keyPressed(KeyEvent e) {

dataKode_keyPressed(e);

}

});

 

data_thnx.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(ActionEvent e) {

tampilDataKeTransaksi();

mutasibank();

mutasiAllTransaksi();

}

});

 

// Membuat Tabel 1

Object[] row = {“Transaksi”, “Jan”, “Feb”,”Mar”,”Apr”,”Mei”,”Jun”,”Jul”,”Agt”,”Sep”,”Okt”,”Nop”,”Des”,”Total”};

tabMode = new DefaultTableModel(null, row);

jScrollPane1.setBounds(new Rectangle(10, 10, 760, 220));

tabel.setModel(tabMode);

tabel.getAutoscrolls();

TableColumn tc0 = tabel.getColumn(“Transaksi”);

tc0.setWidth(170);

tc0.setMinWidth(170);

tc0.setMaxWidth(170);

// Membuat Tabel 2

Object[] row1 = {“Nama”, “Jan”, “Feb”,”Mar”,”Apr”,”Mei”,”Jun”,”Jul”,”Agt”,”Sep”,”Okt”,”Nop”,”Des”,”Total”};

tabMode1 = new DefaultTableModel(null, row1);

jScrollPane11.setBounds(new Rectangle(10, 40, 760, 410));

tabel1.setModel(tabMode1);

tabel1.getAutoscrolls();

TableColumn tc1 = tabel1.getColumn(“Nama”);

tc1.setWidth(170);

tc1.setMinWidth(170);

tc1.setMaxWidth(170);

// Membuat Tabel 3

Object[] row2 = {“Tanggal”, “Jan”, “Feb”,”Mar”,”Apr”,”Mei”,”Jun”,”Jul”,”Agt”,”Sep”,”Okt”,”Nop”,”Des”,”Total”};

tabMode2 = new DefaultTableModel(null, row2);

jScrollPane12.setBounds(new Rectangle(10, 40, 760, 410));

tabel2.setModel(tabMode2);

tabel2.getAutoscrolls();

TableColumn tc2 = tabel2.getColumn(“Tanggal”);

tc2.setWidth(70);

tc2.setMinWidth(70);

tc2.setMaxWidth(70);

// Membuat Tabel 4

Object[] row3 = {“Nama”, “Jan”, “Feb”,”Mar”,”Apr”,”Mei”,”Jun”,”Jul”,”Agt”,”Sep”,”Okt”,”Nop”,”Des”,”Total”};

tabMode3 = new DefaultTableModel(null, row3);

jScrollPane13.setBounds(new Rectangle(10, 40, 760, 410));

tabel3.setModel(tabMode3);

tabel3.getAutoscrolls();

TableColumn tc3 = tabel3.getColumn(“Nama”);

tc3.setWidth(170);

tc3.setMinWidth(170);

tc3.setMaxWidth(170);

 

// Membuat Tabel 5

Object[] row4 = {“Transaksi”, “Jan”, “Feb”,”Mar”,”Apr”,”Mei”,”Jun”,”Jul”,”Agt”,”Sep”,”Okt”,”Nop”,”Des”,”Total”};

tabMode4 = new DefaultTableModel(null, row4);

jScrollPane14.setBounds(new Rectangle(10, 40, 760, 220));

tabel4.setModel(tabMode4);

tabel4.getAutoscrolls();

TableColumn tc4 = tabel4.getColumn(“Transaksi”);

tc4.setWidth(170);

tc4.setMinWidth(170);

tc4.setMaxWidth(170);

 

// Membuat Tabel 6

Object[] row5 = {“Transaksi”,”Tanggal”,”Masuk”,”Keluar”,”Saldo”,”Keterangan”};

tabMode5 = new DefaultTableModel(null, row5);

jScrollPane15.setBounds(new Rectangle(10, 10, 500, 430));

tabel5.setModel(tabMode5);

tabel5.getAutoscrolls();

TableColumn tc5 = tabel4.getColumn(“Transaksi”);

tc5.setWidth(170);

tc5.setMinWidth(170);

tc5.setMaxWidth(170);

 

// Membuat Tabel 7

Object[] row6 = {“Transaksi”,”Tanggal”,”Masuk”,”Bunga”,”Keluar”,”Saldo”,”Kode”,”Keterangan”};

tabMode6 = new DefaultTableModel(null, row6);

jScrollPane16.setBounds(new Rectangle(10, 10, 760, 430));

tabel6.setModel(tabMode6);

tabel6.getAutoscrolls();

TableColumn tc6 = tabel6.getColumn(“Transaksi”);

tc6.setWidth(170);

tc6.setMinWidth(170);

tc6.setMaxWidth(170);

 

// Membuat Tabel 8

Object[] row7 = {“Transaksi”,”Tanggal”,”Masuk”,”Bunga”,”Keluar”,”Saldo”,”Keterangan”};

tabMode7 = new DefaultTableModel(null, row7);

jScrollPane17.setBounds(new Rectangle(320, 270, 450, 180));

tabel7.setModel(tabMode7);

tabel7.getAutoscrolls();

TableColumn tc7 = tabel7.getColumn(“Transaksi”);

tc7.setWidth(170);

tc7.setMinWidth(170);

tc7.setMaxWidth(170);

 

 

cek1.setBounds(new Rectangle(520,10,120,22));

cek1.setText(“”);

 

 

tabel.addMouseListener(new java.awt.event.MouseAdapter() {

// Proses saat TABEL di klik

public void mouseClicked(MouseEvent e) {

tampilDataKeTransaksiKeAnggota();

tampilDataKeTransaksiKeTanggal();

tampilDataKeTransaksiKeBungaAnggota();

}

});

 

tabbedpane.setBounds(new Rectangle(15,42,780,480));

String nameTb1 = “Semua Transaksi”;

JPanel pix1 = new JPanel();

pix1.setLayout(null);

tabbedpane.add(nameTb1, pix1);

 

String nameTb2 = “> by Anggota”;

JPanel pix2 = new JPanel();

pix2.setLayout(null);

tabbedpane.add(nameTb2, pix2);

 

String nameTb3 = “> by Tanggal”;

JPanel pix3 = new JPanel();

pix3.setLayout(null);

tabbedpane.add(nameTb3, pix3);

 

String nameTb4 = “> by Bunga”;

JPanel pix4 = new JPanel();

pix4.setLayout(null);

tabbedpane.add(nameTb4, pix4);

 

String nameTb5 = “by Transaksi”;

JPanel pix5 = new JPanel();

pix5.setLayout(null);

tabbedpane.add(nameTb5, pix5);

 

String nameTb6 = “Mutasi Bank”;

JPanel pix6 = new JPanel();

pix6.setLayout(null);

tabbedpane.add(nameTb6, pix6);

 

String nameTb7 = “All Transaksi”;

JPanel pix7 = new JPanel();

pix7.setLayout(null);

tabbedpane.add(nameTb7, pix7);

 

this.getContentPane().add(jLabel1, null);

this.getContentPane().add(data_thnx, null);

this.getContentPane().add(tabbedpane, null);

this.getContentPane().add(data_total, null);

 

this.getContentPane().add(jScrollPane1, null);

jScrollPane1.getViewport().add(tabel, null);

pix1.add(jScrollPane1, null);

pix1.add(jLabel7);

pix1.add(jLabel8);

pix1.add(jLabel9);

pix1.add(jLabel10);

pix1.add(jLabel11);

pix1.add(jLabel12);

pix1.add(jLabel13);

pix1.add(Totalx01); //total tabungan

pix1.add(Totalx02);

pix1.add(Totalx03);

pix1.add(Totalx04);

pix1.add(Totalx05);

pix1.add(Totalx06); // net income

pix1.add(Totalx07); // saldo bank

pix1.add(jLabel14);

pix1.add(Totalx08);

pix1.add(jLabel15);

pix1.add(Totalx09);

pix1.add(jLabel16);

pix1.add(Totalx10);

jScrollPane1.getViewport().add(tabel, null);

 

this.getContentPane().add(jScrollPane11, null);

jScrollPane11.getViewport().add(tabel1, null);

pix2.add(jScrollPane11, null);

pix2.add(jLabel2);

pix2.add(data_total1);

jScrollPane11.getViewport().add(tabel1, null);

 

this.getContentPane().add(jScrollPane12, null);

jScrollPane12.getViewport().add(tabel2, null);

pix3.add(jScrollPane12, null);

pix3.add(jLabel3);

pix3.add(data_total2);

jScrollPane12.getViewport().add(tabel2, null);

 

this.getContentPane().add(jScrollPane13, null);

jScrollPane13.getViewport().add(tabel3, null);

pix4.add(jScrollPane13, null);

pix4.add(jLabel4);

pix4.add(data_total3);

jScrollPane13.getViewport().add(tabel3, null);

 

this.getContentPane().add(jScrollPane14, null);

jScrollPane14.getViewport().add(tabel4, null);

pix5.add(jScrollPane14, null);

pix5.add(jLabel5);

pix5.add(data_total4);

pix5.add(dataKode);

pix5.add(jLabel6);

pix5.add(jLabel17);

pix5.add(jLabel18);

pix5.add(jLabel19);

pix5.add(Totalx11);

pix5.add(Totalx12);

pix5.add(Totalx13);

jScrollPane17.getViewport().add(tabel7, null);

this.getContentPane().add(jScrollPane17, null);

jScrollPane17.getViewport().add(tabel7, null);

pix5.add(jScrollPane17, null);

jScrollPane17.getViewport().add(tabel7, null);

 

this.getContentPane().add(jScrollPane15, null);

jScrollPane15.getViewport().add(tabel5, null);

pix6.add(jScrollPane15, null);

pix6.add(cek1);

jScrollPane15.getViewport().add(tabel5, null);

 

this.getContentPane().add(jScrollPane16, null);

jScrollPane16.getViewport().add(tabel6, null);

pix7.add(jScrollPane16, null);

jScrollPane16.getViewport().add(tabel6, null);

 

tampilDataKeTransaksi();

 

}

 

//All Transaksi

public void tampilDataKeTransaksi() {

hapusTabel();

String tahunx = String.valueOf(data_thnx.getSelectedItem());

String trans = “”;

int b01 = 0;

int b02 = 0;

int b03 = 0;

int b04 = 0;

int b05 = 0;

int b06 = 0;

int b07 = 0;

int b08 = 0;

int b09 = 0;

int b10 = 0;

int b11 = 0;

int b12 = 0;

int bgx = 0;

int totalin = 0;

int gtotal = 0;

int nilai01 = 0;

int nilai02 = 0;

int nilai03 = 0;

int nilai04 = 0;

int nilai05 = 0;

int nilai06 = 0;

int nilai07 = 0;

int nilai08 = 0;

int nilai09 = 0;

int nilai10 = 0;

int nilai11 = 0;

int nilai12 = 0;

 

Totalx01.setText(“0”);

Totalx02.setText(“0”);

Totalx03.setText(“0”);

Totalx04.setText(“0”);

Totalx05.setText(“0”);

Totalx06.setText(“0”);

Totalx07.setText(“0”);

bgx = 0;

Connection konek = new koneksi_database().koneksiDatabase();

try {

String sql = “Select trans from data_trans where year(tanggal) = ‘”+tahunx+”‘ group by trans”;

Statement stat = konek.createStatement();

ResultSet set = stat.executeQuery(sql);

while (set.next()) {

b01 = 0;

b02 = 0;

b03 = 0;

b04 = 0;

b05 = 0;

b06 = 0;

b07 = 0;

b08 = 0;

b09 = 0;

b10 = 0;

b11 = 0;

b12 = 0;

totalin = 0;

trans = set.getString(“trans”);

try {

String sql1 = “Select * from data_trans where year(tanggal) = ‘”+tahunx+”‘ and trans = ‘”+trans+”‘”;

Statement stat1 = konek.createStatement();

ResultSet set1 = stat1.executeQuery(sql1);

while (set1.next()) {

String trans1 = set1.getString(“trans”);

String nomin = set1.getString(“nominal”);

String bungx = set1.getString(“bunga”);

String tglsx = set1.getString(“tanggal”);

String blns = tglsx.substring(5,7);

 

if (trans1.equalsIgnoreCase(trans)) {

if (blns.equals(“01”)) {

b01 = b01 + Integer.parseInt(nomin);

};

if (blns.equals(“02”)) {

b02 = b02 + Integer.parseInt(nomin);

};

if (blns.equals(“03”)) {

b03 = b03 + Integer.parseInt(nomin);

};

if (blns.equals(“04”)) {

b04 = b04 + Integer.parseInt(nomin);

};

if (blns.equals(“05”)) {

b05 = b05 + Integer.parseInt(nomin);

};

if (blns.equals(“06”)) {

b06 = b06 + Integer.parseInt(nomin);

};

if (blns.equals(“07”)) {

b07 = b07 + Integer.parseInt(nomin);

};

if (blns.equals(“08”)) {

b08 = b08 + Integer.parseInt(nomin);

};

if (blns.equals(“09”)) {

b09 = b09 + Integer.parseInt(nomin);

};

if (blns.equals(“10”)) {

b10 = b10 + Integer.parseInt(nomin);

};

if (blns.equals(“11”)) {

b11 = b11 + Integer.parseInt(nomin);

};

if (blns.equals(“12”)) {

b12 = b12 + Integer.parseInt(nomin);

};

bgx = bgx + Integer.parseInt(bungx);

totalin = b01 + b02 + b03 + b04 + b05 + b06 + b07 + b08 + b09 + b10 + b11 + b12;

}

}

set1.close();

} catch (SQLException se) {

}

 

String bln01 = Integer.toString(b01);

String bln02 = Integer.toString(b02);

String bln03 = Integer.toString(b03);

String bln04 = Integer.toString(b04);

String bln05 = Integer.toString(b05);

String bln06 = Integer.toString(b06);

String bln07 = Integer.toString(b07);

String bln08 = Integer.toString(b08);

String bln09 = Integer.toString(b09);

String bln10 = Integer.toString(b10);

String bln11 = Integer.toString(b11);

String bln12 = Integer.toString(b12);

String ttlxs = Integer.toString(totalin);

gtotal = gtotal + totalin;

 

if (trans.equals(“01.Tabungan Wajib”)) {

nilai01 = totalin;

}

if (trans.equals(“02.Iuran Wajib Anggota”)) {

nilai02 = totalin;

}

if (trans.equals(“03.Pinjaman Anggota”)) {

nilai03 = totalin;

}

if (trans.equals(“04.Cicilan Pinjaman”)) {

nilai04 = totalin;

}

if (trans.equals(“05.Pengambilan Oleh Anggota”)) {

nilai05 = totalin;

}

if (trans.equals(“06.Pembagian Hasil Usaha”)) {

nilai06 = totalin;

}

if (trans.equals(“07.Pendapatan Bunga Bank”)) {

nilai07 = totalin;

}

if (trans.equals(“08.Pendapatan Lain Lain”)) {

nilai08 = totalin;

}

if (trans.equals(“09.Pengeluaran Lain Lain”)) {

nilai09 = totalin;

}

if (trans.equals(“10.Setoran Ke Acct Bank”)) {

nilai10 = totalin;

}

if (trans.equals(“11.Pengambilan Acct Bank”)) {

nilai11 = totalin;

}

if (trans.equals(“12.Biaya Acct Bank”)) {

nilai12 = totalin;

}

 

int tabwajib = nilai01 + nilai02;

int lababung = nilai08 + bgx;

int pengeluaran = nilai06 + nilai09 + nilai12;

int netinc = (lababung + nilai07) – pengeluaran;

int piutang = (nilai03 – nilai04);

int salbank = (nilai10 – nilai11 – nilai12) + nilai07;

int danain = (tabwajib + lababung + nilai07);

int saldotahun = danain – pengeluaran;

 

String[] data = {trans,bln01,bln02,bln03,bln04,bln05,bln06,bln07,bln08,bln09,bln10,bln11,bln12,ttlxs};

tabMode.addRow(data);

data_total.setText(Integer.toString(gtotal));

Totalx01.setText(Integer.toString(tabwajib));

Totalx02.setText(Integer.toString(lababung));

Totalx03.setText(Integer.toString(nilai07));

Totalx04.setText(Integer.toString(pengeluaran));

Totalx05.setText(Integer.toString(netinc));

Totalx06.setText(Integer.toString(piutang));

Totalx07.setText(Integer.toString(salbank));

Totalx08.setText(Integer.toString(danain));

Totalx09.setText(Integer.toString(pengeluaran));

Totalx10.setText(Integer.toString(saldotahun));

}

stat.close();

}

catch (Exception e) {}

}

 

public void hapusTabel() {

int row = tabMode.getRowCount();

for (int i = 0; i < row; i++) {

tabMode.removeRow(0);

}

}

 

// Transaksi By Anggota

public void tampilDataKeTransaksiKeAnggota() {

hapusTabel1();

int row = tabel.getSelectedRow();

String trans = tabMode.getValueAt(row, 0).toString();

String tahunx = String.valueOf(data_thnx.getSelectedItem());

String kodesx = “”;

String namax = “”;

int b01 = 0;

int b02 = 0;

int b03 = 0;

int b04 = 0;

int b05 = 0;

int b06 = 0;

int b07 = 0;

int b08 = 0;

int b09 = 0;

int b10 = 0;

int b11 = 0;

int b12 = 0;

int totalin = 0;

int gtotal = 0;

Connection konek = new koneksi_database().koneksiDatabase();

try {

String sql = “Select kode from data_trans where year(tanggal) = ‘”+tahunx+”‘ and trans = ‘”+trans+”‘ group by kode”;

Statement stat = konek.createStatement();

ResultSet set = stat.executeQuery(sql);

while (set.next()) {

b01 = 0;

b02 = 0;

b03 = 0;

b04 = 0;

b05 = 0;

b06 = 0;

b07 = 0;

b08 = 0;

b09 = 0;

b10 = 0;

b11 = 0;

b12 = 0;

totalin = 0;

kodesx = set.getString(“kode”);

String sqlxz = “select * from data_anggota where kode = ‘”+kodesx+”‘”;

try {

Statement statxz = konek.createStatement();

ResultSet setxz = statxz.executeQuery(sqlxz);

while (setxz.next()) {

namax = setxz.getString(“nama”);

}

setxz.close();

} catch (SQLException sx) {

}

try {

String sql1 = “Select * from data_trans where year(tanggal) = ‘”+tahunx+”‘ and kode = ‘”+kodesx+”‘ and trans = ‘”+trans+”‘”;

Statement stat1 = konek.createStatement();

ResultSet set1 = stat1.executeQuery(sql1);

while (set1.next()) {

String kodesx1 = set1.getString(“kode”);

String nomin = set1.getString(“nominal”);

String bungx = set1.getString(“bunga”);

String tglsx = set1.getString(“tanggal”);

String blns = tglsx.substring(5,7);

 

if (kodesx1.equalsIgnoreCase(kodesx)) {

if (blns.equals(“01”)) {

b01 = b01 + Integer.parseInt(nomin);

};

if (blns.equals(“02”)) {

b02 = b02 + Integer.parseInt(nomin);

};

if (blns.equals(“03”)) {

b03 = b03 + Integer.parseInt(nomin);

};

if (blns.equals(“04”)) {

b04 = b04 + Integer.parseInt(nomin);

};

if (blns.equals(“05”)) {

b05 = b05 + Integer.parseInt(nomin);

};

if (blns.equals(“06”)) {

b06 = b06 + Integer.parseInt(nomin);

};

if (blns.equals(“07”)) {

b07 = b07 + Integer.parseInt(nomin);

};

if (blns.equals(“08”)) {

b08 = b08 + Integer.parseInt(nomin);

};

if (blns.equals(“09”)) {

b09 = b09 + Integer.parseInt(nomin);

};

if (blns.equals(“10”)) {

b10 = b10 + Integer.parseInt(nomin);

};

if (blns.equals(“11”)) {

b11 = b11 + Integer.parseInt(nomin);

};

if (blns.equals(“12”)) {

b12 = b12 + Integer.parseInt(nomin);

};

totalin = b01 + b02 + b03 + b04 + b05 + b06 + b07 + b08 + b09 + b10 + b11 + b12;

}

}

set1.close();

} catch (SQLException se) {

}

 

String bln01 = Integer.toString(b01);

String bln02 = Integer.toString(b02);

String bln03 = Integer.toString(b03);

String bln04 = Integer.toString(b04);

String bln05 = Integer.toString(b05);

String bln06 = Integer.toString(b06);

String bln07 = Integer.toString(b07);

String bln08 = Integer.toString(b08);

String bln09 = Integer.toString(b09);

String bln10 = Integer.toString(b10);

String bln11 = Integer.toString(b11);

String bln12 = Integer.toString(b12);

String ttlxs = Integer.toString(totalin);

gtotal = gtotal + totalin;

 

String[] data = {namax,bln01,bln02,bln03,bln04,bln05,bln06,bln07,bln08,bln09,bln10,bln11,bln12,ttlxs};

tabMode1.addRow(data);

jLabel2.setText(“Transaksi : “+trans);

data_total1.setText(Integer.toString(gtotal));

}

stat.close();

}

catch (Exception e) {}

}

 

public void hapusTabel1() {

int row1 = tabMode1.getRowCount();

for (int i = 0; i < row1; i++) {

tabMode1.removeRow(0);

}

}

 

// Transaksi by Tanggal

public void tampilDataKeTransaksiKeTanggal() {

hapusTabel2();

int row = tabel.getSelectedRow();

String trans = tabMode.getValueAt(row, 0).toString();

String tahunx = String.valueOf(data_thnx.getSelectedItem());

String tglx = “”;

int b01 = 0;

int b02 = 0;

int b03 = 0;

int b04 = 0;

int b05 = 0;

int b06 = 0;

int b07 = 0;

int b08 = 0;

int b09 = 0;

int b10 = 0;

int b11 = 0;

int b12 = 0;

int totalin = 0;

int gtotal = 0;

Connection konek = new koneksi_database().koneksiDatabase();

try {

String sql = “Select tanggal from data_trans where year(tanggal) = ‘”+tahunx+”‘ and trans = ‘”+trans+”‘ group by tanggal desc”;

Statement stat = konek.createStatement();

ResultSet set = stat.executeQuery(sql);

while (set.next()) {

b01 = 0;

b02 = 0;

b03 = 0;

b04 = 0;

b05 = 0;

b06 = 0;

b07 = 0;

b08 = 0;

b09 = 0;

b10 = 0;

b11 = 0;

b12 = 0;

totalin = 0;

tglx = set.getString(“tanggal”);

try {

String sql1 = “Select * from data_trans where year(tanggal) = ‘”+tahunx+”‘ and tanggal = ‘”+tglx+”‘ and trans = ‘”+trans+”‘”;

Statement stat1 = konek.createStatement();

ResultSet set1 = stat1.executeQuery(sql1);

while (set1.next()) {

String tglx1 = set1.getString(“tanggal”);

String nomin = set1.getString(“nominal”);

String bungx = set1.getString(“bunga”);

String tglsx = set1.getString(“tanggal”);

String blns = tglsx.substring(5,7);

 

if (tglx1.equalsIgnoreCase(tglx)) {

if (blns.equals(“01”)) {

b01 = b01 + Integer.parseInt(nomin);

};

if (blns.equals(“02”)) {

b02 = b02 + Integer.parseInt(nomin);

};

if (blns.equals(“03”)) {

b03 = b03 + Integer.parseInt(nomin);

};

if (blns.equals(“04”)) {

b04 = b04 + Integer.parseInt(nomin);

};

if (blns.equals(“05”)) {

b05 = b05 + Integer.parseInt(nomin);

};

if (blns.equals(“06”)) {

b06 = b06 + Integer.parseInt(nomin);

};

if (blns.equals(“07”)) {

b07 = b07 + Integer.parseInt(nomin);

};

if (blns.equals(“08”)) {

b08 = b08 + Integer.parseInt(nomin);

};

if (blns.equals(“09”)) {

b09 = b09 + Integer.parseInt(nomin);

};

if (blns.equals(“10”)) {

b10 = b10 + Integer.parseInt(nomin);

};

if (blns.equals(“11”)) {

b11 = b11 + Integer.parseInt(nomin);

};

if (blns.equals(“12”)) {

b12 = b12 + Integer.parseInt(nomin);

};

totalin = b01 + b02 + b03 + b04 + b05 + b06 + b07 + b08 + b09 + b10 + b11 + b12;

}

}

set1.close();

} catch (SQLException se) {

}

 

String bln01 = Integer.toString(b01);

String bln02 = Integer.toString(b02);

String bln03 = Integer.toString(b03);

String bln04 = Integer.toString(b04);

String bln05 = Integer.toString(b05);

String bln06 = Integer.toString(b06);

String bln07 = Integer.toString(b07);

String bln08 = Integer.toString(b08);

String bln09 = Integer.toString(b09);

String bln10 = Integer.toString(b10);

String bln11 = Integer.toString(b11);

String bln12 = Integer.toString(b12);

String ttlxs = Integer.toString(totalin);

gtotal = gtotal + totalin;

 

String[] data = {tglx,bln01,bln02,bln03,bln04,bln05,bln06,bln07,bln08,bln09,bln10,bln11,bln12,ttlxs};

tabMode2.addRow(data);

jLabel3.setText(“Transaksi : “+trans);

data_total2.setText(Integer.toString(gtotal));

}

stat.close();

}

catch (Exception e) {}

}

 

public void hapusTabel2() {

int row2 = tabMode2.getRowCount();

for (int i = 0; i < row2; i++) {

tabMode2.removeRow(0);

}

}

 

// Transaksi By Bunga Anggota

public void tampilDataKeTransaksiKeBungaAnggota() {

hapusTabel3();

int row = tabel.getSelectedRow();

String trans = tabMode.getValueAt(row, 0).toString();

String tahunx = String.valueOf(data_thnx.getSelectedItem());

String kodesx = “”;

String namax = “”;

int b01 = 0;

int b02 = 0;

int b03 = 0;

int b04 = 0;

int b05 = 0;

int b06 = 0;

int b07 = 0;

int b08 = 0;

int b09 = 0;

int b10 = 0;

int b11 = 0;

int b12 = 0;

int totalin = 0;

int gtotal = 0;

Connection konek = new koneksi_database().koneksiDatabase();

try {

String sql = “Select kode from data_trans where year(tanggal) = ‘”+tahunx+”‘ and trans = ‘”+trans+”‘ group by kode”;

Statement stat = konek.createStatement();

ResultSet set = stat.executeQuery(sql);

while (set.next()) {

b01 = 0;

b02 = 0;

b03 = 0;

b04 = 0;

b05 = 0;

b06 = 0;

b07 = 0;

b08 = 0;

b09 = 0;

b10 = 0;

b11 = 0;

b12 = 0;

totalin = 0;

kodesx = set.getString(“kode”);

String sqlxz = “select * from data_anggota where kode = ‘”+kodesx+”‘”;

try {

Statement statxz = konek.createStatement();

ResultSet setxz = statxz.executeQuery(sqlxz);

while (setxz.next()) {

namax = setxz.getString(“nama”);

}

setxz.close();

} catch (SQLException sx) {

}

try {

String sql1 = “Select * from data_trans where year(tanggal) = ‘”+tahunx+”‘ and kode = ‘”+kodesx+”‘ and trans = ‘”+trans+”‘”;

Statement stat1 = konek.createStatement();

ResultSet set1 = stat1.executeQuery(sql1);

while (set1.next()) {

String kodesx1 = set1.getString(“kode”);

String nomin = set1.getString(“nominal”);

String bungx = set1.getString(“bunga”);

String tglsx = set1.getString(“tanggal”);

String blns = tglsx.substring(5,7);

 

if (kodesx1.equalsIgnoreCase(kodesx)) {

if (blns.equals(“01”)) {

b01 = b01 + Integer.parseInt(bungx);

};

if (blns.equals(“02”)) {

b02 = b02 + Integer.parseInt(bungx);

};

if (blns.equals(“03”)) {

b03 = b03 + Integer.parseInt(bungx);

};

if (blns.equals(“04”)) {

b04 = b04 + Integer.parseInt(bungx);

};

if (blns.equals(“05”)) {

b05 = b05 + Integer.parseInt(bungx);

};

if (blns.equals(“06”)) {

b06 = b06 + Integer.parseInt(bungx);

};

if (blns.equals(“07”)) {

b07 = b07 + Integer.parseInt(bungx);

};

if (blns.equals(“08”)) {

b08 = b08 + Integer.parseInt(bungx);

};

if (blns.equals(“09”)) {

b09 = b09 + Integer.parseInt(bungx);

};

if (blns.equals(“10”)) {

b10 = b10 + Integer.parseInt(bungx);

};

if (blns.equals(“11”)) {

b11 = b11 + Integer.parseInt(bungx);

};

if (blns.equals(“12”)) {

b12 = b12 + Integer.parseInt(bungx);

};

totalin = b01 + b02 + b03 + b04 + b05 + b06 + b07 + b08 + b09 + b10 + b11 + b12;

}

}

set1.close();

} catch (SQLException se) {

}

 

String bln01 = Integer.toString(b01);

String bln02 = Integer.toString(b02);

String bln03 = Integer.toString(b03);

String bln04 = Integer.toString(b04);

String bln05 = Integer.toString(b05);

String bln06 = Integer.toString(b06);

String bln07 = Integer.toString(b07);

String bln08 = Integer.toString(b08);

String bln09 = Integer.toString(b09);

String bln10 = Integer.toString(b10);

String bln11 = Integer.toString(b11);

String bln12 = Integer.toString(b12);

String ttlxs = Integer.toString(totalin);

gtotal = gtotal + totalin;

 

String[] data = {namax,bln01,bln02,bln03,bln04,bln05,bln06,bln07,bln08,bln09,bln10,bln11,bln12,ttlxs};

tabMode3.addRow(data);

jLabel3.setText(“Transaksi : “+trans);

data_total3.setText(Integer.toString(gtotal));

}

stat.close();

}

catch (Exception e) {}

}

 

public void hapusTabel3() {

int row3 = tabMode3.getRowCount();

for (int i = 0; i < row3; i++) {

tabMode3.removeRow(0);

}

}

 

// Transaksi By Bunga Anggota

public void tampilDataAnggotaTransaksi() {

hapusTabel4();

int row = tabel.getSelectedRow();

String tahunx = String.valueOf(data_thnx.getSelectedItem());

String kodesx = dataKode.getText();

String trans = “”;

String namax = “”;

int b01 = 0;

int b02 = 0;

int b03 = 0;

int b04 = 0;

int b05 = 0;

int b06 = 0;

int b07 = 0;

int b08 = 0;

int b09 = 0;

int b10 = 0;

int b11 = 0;

int b12 = 0;

int totalin = 0;

int gtotal = 0;

int nilai01 = 0;

int nilai02 = 0;

int nilai03 = 0;

int nilai04 = 0;

int nilai05 = 0;

int nilai06 = 0;

int nilai07 = 0;

int nilai08 = 0;

int nilai09 = 0;

int nilai10 = 0;

int nilai11 = 0;

int nilai12 = 0;

Connection konek = new koneksi_database().koneksiDatabase();

try {

String sql = “Select trans from data_trans where year(tanggal) = ‘”+tahunx+”‘ and kode = ‘”+kodesx+”‘ group by trans”;

Statement stat = konek.createStatement();

ResultSet set = stat.executeQuery(sql);

while (set.next()) {

b01 = 0;

b02 = 0;

b03 = 0;

b04 = 0;

b05 = 0;

b06 = 0;

b07 = 0;

b08 = 0;

b09 = 0;

b10 = 0;

b11 = 0;

b12 = 0;

totalin = 0;

trans = set.getString(“trans”);

String sqlxz = “select * from data_anggota where kode = ‘”+kodesx+”‘”;

try {

Statement statxz = konek.createStatement();

ResultSet setxz = statxz.executeQuery(sqlxz);

while (setxz.next()) {

namax = setxz.getString(“nama”);

}

setxz.close();

} catch (SQLException sx) {

}

try {

String sql1 = “Select * from data_trans where year(tanggal) = ‘”+tahunx+”‘ and kode = ‘”+kodesx+”‘ and trans = ‘”+trans+”‘”;

Statement stat1 = konek.createStatement();

ResultSet set1 = stat1.executeQuery(sql1);

while (set1.next()) {

String kodesx1 = set1.getString(“kode”);

String nomin = set1.getString(“nominal”);

String bungx = set1.getString(“bunga”);

String tglsx = set1.getString(“tanggal”);

String blns = tglsx.substring(5,7);

 

if (kodesx1.equalsIgnoreCase(kodesx)) {

if (blns.equals(“01”)) {

b01 = b01 + Integer.parseInt(nomin);

};

if (blns.equals(“02”)) {

b02 = b02 + Integer.parseInt(nomin);

};

if (blns.equals(“03”)) {

b03 = b03 + Integer.parseInt(nomin);

};

if (blns.equals(“04”)) {

b04 = b04 + Integer.parseInt(nomin);

};

if (blns.equals(“05”)) {

b05 = b05 + Integer.parseInt(nomin);

};

if (blns.equals(“06”)) {

b06 = b06 + Integer.parseInt(nomin);

};

if (blns.equals(“07”)) {

b07 = b07 + Integer.parseInt(nomin);

};

if (blns.equals(“08”)) {

b08 = b08 + Integer.parseInt(nomin);

};

if (blns.equals(“09”)) {

b09 = b09 + Integer.parseInt(nomin);

};

if (blns.equals(“10”)) {

b10 = b10 + Integer.parseInt(nomin);

};

if (blns.equals(“11”)) {

b11 = b11 + Integer.parseInt(nomin);

};

if (blns.equals(“12”)) {

b12 = b12 + Integer.parseInt(nomin);

};

totalin = b01 + b02 + b03 + b04 + b05 + b06 + b07 + b08 + b09 + b10 + b11 + b12;

}

}

set1.close();

} catch (SQLException se) {

}

 

String bln01 = Integer.toString(b01);

String bln02 = Integer.toString(b02);

String bln03 = Integer.toString(b03);

String bln04 = Integer.toString(b04);

String bln05 = Integer.toString(b05);

String bln06 = Integer.toString(b06);

String bln07 = Integer.toString(b07);

String bln08 = Integer.toString(b08);

String bln09 = Integer.toString(b09);

String bln10 = Integer.toString(b10);

String bln11 = Integer.toString(b11);

String bln12 = Integer.toString(b12);

String ttlxs = Integer.toString(totalin);

gtotal = gtotal + totalin;

 

if (trans.equals(“01.Tabungan Wajib”)) {

nilai01 = totalin;

}

if (trans.equals(“02.Iuran Wajib Anggota”)) {

nilai02 = totalin;

}

if (trans.equals(“03.Pinjaman Anggota”)) {

nilai03 = totalin;

}

if (trans.equals(“04.Cicilan Pinjaman”)) {

nilai04 = totalin;

}

if (trans.equals(“05.Pengambilan Oleh Anggota”)) {

nilai05 = totalin;

}

if (trans.equals(“06.Pembagian Hasil Usaha”)) {

nilai06 = totalin;

}

if (trans.equals(“07.Pendapatan Bunga Bank”)) {

nilai07 = totalin;

}

if (trans.equals(“08.Pendapatan Lain Lain”)) {

nilai08 = totalin;

}

if (trans.equals(“09.Pengeluaran Lain Lain”)) {

nilai09 = totalin;

}

if (trans.equals(“10.Setoran Ke Acct Bank”)) {

nilai10 = totalin;

}

if (trans.equals(“11.Pengambilan Acct Bank”)) {

nilai11 = totalin;

}

if (trans.equals(“12.Biaya Acct Bank”)) {

nilai12 = totalin;

}

 

int wajibiuran = nilai01 + nilai02 ;

int sisapinjam = nilai03 – nilai04 ;

int saldonetto = wajibiuran – sisapinjam ;

 

String[] data = {trans,bln01,bln02,bln03,bln04,bln05,bln06,bln07,bln08,bln09,bln10,bln11,bln12,ttlxs};

tabMode4.addRow(data);

data_total4.setText(Integer.toString(gtotal));

jLabel6.setText(“Nama : “+namax);

Totalx11.setText(Integer.toString(wajibiuran));

Totalx12.setText(Integer.toString(sisapinjam));

Totalx13.setText(Integer.toString(saldonetto));

}

stat.close();

}

catch (Exception e) {}

}

 

public void hapusTabel4() {

int row4 = tabMode4.getRowCount();

for (int i = 0; i < row4; i++) {

tabMode4.removeRow(0);

}

}

 

public void dataKode_keyPressed(KeyEvent e) {

int ascii = e.getKeyCode();

//String msx = String.valueOf(ascii);

Connection konek = new koneksi_database().koneksiDatabase();

if (ascii == 10) {

if (dataKode.getText().equalsIgnoreCase(“”)) {

JOptionPane.showMessageDialog(null,”Kode Nomor Anggota tersebut tidak ada !”,”Pesan”,JOptionPane.OK_OPTION);

}

else {

String kodx = dataKode.getText();

String sql = “select * from data_anggota where kode = ‘”+kodx+”‘”;

String nam = “”;

try {

PreparedStatement stat = konek.prepareStatement(sql);

ResultSet set = stat.executeQuery();

while (set.next()) {

nam = set.getString(“nama”);

}

if (nam.equalsIgnoreCase(“”)) {

JOptionPane.showMessageDialog(null,”Kode Anggota tidak di temukan !”,”Pesan”,JOptionPane.OK_OPTION);

dataKode.setEditable(true);

dataKode.requestFocus();

tampilDataAnggotaTransaksi();

mutasiAllTransaksiAnggota();

} else {

tampilDataAnggotaTransaksi();

mutasiAllTransaksiAnggota();

}

set.close();

} catch (Exception ie) {

}

}

}

}

 

 

public void mutasibank() {

hapusTabel5();

String transx = “”;

String totalin = “”;

String tglx = “”;

String ketx = “”;

int masuk01 = 0;

int keluar01 = 0;

int saldox = 0;

String sql = “select * from data_trans order by tanggal ASC”;

Connection konek = new koneksi_database().koneksiDatabase();

try {

Statement stat = konek.createStatement();

ResultSet set = stat.executeQuery(sql);

while (set.next()) {

transx = set.getString(“trans”);

totalin = set.getString(“nominal”);

tglx = set.getString(“tanggal”);

ketx = set.getString(“keterangan”);

boolean oke = false;

masuk01 = 0;

keluar01 = 0;

if (transx.equals(“07.Pendapatan Bunga Bank”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“10.Setoran Ke Acct Bank”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“11.Pengambilan Acct Bank”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“12.Biaya Acct Bank”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

if (oke == true) {

saldox = saldox + (masuk01 – keluar01);

 

String mskx = Integer.toString(masuk01);

String kelx = Integer.toString(keluar01);

String sldx = Integer.toString(saldox);

 

String[] data = {transx,tglx,mskx,kelx,sldx,ketx};

tabMode5.addRow(data);

}

}

} catch (SQLException se) {

}

}

 

public void hapusTabel5() {

int row5 = tabMode5.getRowCount();

for (int i = 0; i < row5; i++) {

tabMode5.removeRow(0);

}

}

 

public void mutasiAllTransaksi() {

hapusTabel6();

String transx = “”;

String totalin = “”;

String bungax = “”;

String tglx = “”;

String kodex = “”;

String ketx = “”;

int masuk01 = 0;

int bunga01 = 0;

int keluar01 = 0;

int saldox = 0;

String sql = “select * from data_trans order by tanggal ASC”;

Connection konek = new koneksi_database().koneksiDatabase();

try {

Statement stat = konek.createStatement();

ResultSet set = stat.executeQuery(sql);

while (set.next()) {

transx = set.getString(“trans”);

totalin = set.getString(“nominal”);

bungax = set.getString(“bunga”);

tglx = set.getString(“tanggal”);

kodex = set.getString(“kode”);

ketx = set.getString(“keterangan”);

boolean oke = false;

masuk01 = 0;

keluar01 = 0;

bunga01 = 0;

if (transx.equals(“01.Tabungan Wajib”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“02.Iuran Wajib Anggota”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“03.Pinjaman Anggota”)) {

keluar01 = Integer.parseInt(totalin);

bunga01 = Integer.parseInt(bungax);

oke = true;

}

if (transx.equals(“04.Cicilan Pinjaman”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“05.Pengambilan Oleh Anggota”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“06.Pembagian Hasil Usaha”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“07.Pendapatan Bunga Bank”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“08.Pendapatan Lain Lain”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“09.Pengeluaran Lain Lain”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“10.Setoran Ke Acct Bank”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“11.Pengambilan Acct Bank”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“12.Biaya Acct Bank”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

//…………………………..

 

if (oke == true) {

saldox = saldox + ((masuk01 + bunga01) – keluar01);

 

String mskx = Integer.toString(masuk01);

String bngx = Integer.toString(bunga01);

String kelx = Integer.toString(keluar01);

String sldx = Integer.toString(saldox);

 

 

String[] data = {transx,tglx,mskx,bngx,kelx,sldx,kodex,ketx};

tabMode6.addRow(data);

}

}

} catch (SQLException se) {

}

}

 

public void hapusTabel6() {

int row6 = tabMode6.getRowCount();

for (int i = 0; i < row6; i++) {

tabMode6.removeRow(0);

}

}

 

public void mutasiAllTransaksiAnggota() {

hapusTabel7();

String transx = “”;

String totalin = “”;

String bungax = “”;

String tglx = “”;

String kodex = dataKode.getText();

String ketx = “”;

int masuk01 = 0;

int bunga01 = 0;

int keluar01 = 0;

int saldox = 0;

String sql = “select * from data_trans where kode = ‘”+kodex+”‘ order by tanggal,trans ASC”;

Connection konek = new koneksi_database().koneksiDatabase();

try {

Statement stat = konek.createStatement();

ResultSet set = stat.executeQuery(sql);

while (set.next()) {

transx = set.getString(“trans”);

totalin = set.getString(“nominal”);

bungax = set.getString(“bunga”);

tglx = set.getString(“tanggal”);

kodex = set.getString(“kode”);

ketx = set.getString(“keterangan”);

boolean oke = false;

masuk01 = 0;

keluar01 = 0;

bunga01 = 0;

if (transx.equals(“01.Tabungan Wajib”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“02.Iuran Wajib Anggota”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“03.Pinjaman Anggota”)) {

keluar01 = Integer.parseInt(totalin);

bunga01 = Integer.parseInt(bungax);

oke = true;

}

if (transx.equals(“04.Cicilan Pinjaman”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“05.Pengambilan Oleh Anggota”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“06.Pembagian Hasil Usaha”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“07.Pendapatan Bunga Bank”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“08.Pendapatan Lain Lain”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“09.Pengeluaran Lain Lain”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“10.Setoran Ke Acct Bank”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“11.Pengambilan Acct Bank”)) {

masuk01 = Integer.parseInt(totalin);

oke = true;

}

if (transx.equals(“12.Biaya Acct Bank”)) {

keluar01 = Integer.parseInt(totalin);

oke = true;

}

//…………………………..

 

if (oke == true) {

saldox = saldox + ((masuk01 + bunga01) – keluar01);

 

String mskx = Integer.toString(masuk01);

String bngx = Integer.toString(bunga01);

String kelx = Integer.toString(keluar01);

String sldx = Integer.toString(saldox);

 

String[] data = {transx,tglx,mskx,bngx,kelx,sldx,ketx};

tabMode7.addRow(data);

}

}

} catch (SQLException se) {

}

}

 

public void hapusTabel7() {

int row7 = tabMode7.getRowCount();

for (int i = 0; i < row7; i++) {

tabMode7.removeRow(0);

}

}

 

class batasiInput {

byte length;

PlainDocument filter;

public batasiInput(byte length) {

this.length = length;

}

 

public PlainDocument getFilter() {

filter = new javax.swing.text.PlainDocument() {

public void insertString(int offs, String str, AttributeSet a) throws

BadLocationException {

int ab = dataKode.getText().length();

if (ab < length) {

super.insertString(offs, str, a);

}

}

};

return filter;

}

}

}

This entry was posted in Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s