From e2fa629ea8958b9ea8ccbb4b10d4fa503be2b17f Mon Sep 17 00:00:00 2001 From: ocaanng Date: Sun, 18 Jun 2023 22:35:23 +0800 Subject: [PATCH] kumpul task --- Task1/.vscode/settings.json | 8 + Task1/README.md | 20 + Task1/bin/App.class | Bin 0 -> 450 bytes Task1/bin/com/config/MyConfig.class | Bin 0 -> 1154 bytes Task1/bin/com/controller/controllerDB.class | Bin 0 -> 4228 bytes Task1/bin/com/layouts/DeleteData.class | Bin 0 -> 1420 bytes Task1/bin/com/layouts/InsertData.class | Bin 0 -> 1584 bytes Task1/bin/com/layouts/Menu.class | Bin 0 -> 1823 bytes Task1/bin/com/layouts/ReadData.class | Bin 0 -> 1717 bytes Task1/bin/com/layouts/UpdateData.class | Bin 0 -> 3893 bytes Task1/bin/com/models/Produk.class | Bin 0 -> 1200 bytes Task1/src/App.java | 9 + Task1/src/com/config/MyConfig.java | 456 +++++ Task1/src/com/controller/controllerDB.java | 123 ++ Task1/src/com/layouts/DeleteData.java | 35 + Task1/src/com/layouts/InsertData.java | 35 + Task1/src/com/layouts/Menu.java | 59 + Task1/src/com/layouts/ReadData.java | 58 + Task1/src/com/layouts/UpdateData.java | 123 ++ Task1/src/com/models/Produk.java | 40 + Task2/.vscode/settings.json | 6 + Task2/build.xml | 73 + Task2/build/classes/.netbeans_automatic_build | 0 .../build/classes/.netbeans_update_resources | 0 Task2/build/classes/App$1.class | Bin 0 -> 944 bytes Task2/build/classes/App$2.class | Bin 0 -> 692 bytes Task2/build/classes/App$3.class | Bin 0 -> 2682 bytes Task2/build/classes/App$4.class | Bin 0 -> 2713 bytes Task2/build/classes/App$5.class | Bin 0 -> 861 bytes Task2/build/classes/App$6.class | Bin 0 -> 3068 bytes Task2/build/classes/App$7.class | Bin 0 -> 1820 bytes Task2/build/classes/App$8.class | Bin 0 -> 501 bytes Task2/build/classes/App.class | Bin 0 -> 12221 bytes Task2/build/classes/App.form | 461 +++++ Task2/manifest.mf | 3 + Task2/nbproject/build-impl.xml | 1771 +++++++++++++++++ Task2/nbproject/genfiles.properties | 8 + Task2/nbproject/private/private.properties | 2 + Task2/nbproject/private/private.xml | 9 + Task2/nbproject/project.properties | 97 + Task2/nbproject/project.xml | 15 + Task2/src/App.form | 461 +++++ Task2/src/App.java | 545 +++++ 43 files changed, 4417 insertions(+) create mode 100644 Task1/.vscode/settings.json create mode 100644 Task1/README.md create mode 100644 Task1/bin/App.class create mode 100644 Task1/bin/com/config/MyConfig.class create mode 100644 Task1/bin/com/controller/controllerDB.class create mode 100644 Task1/bin/com/layouts/DeleteData.class create mode 100644 Task1/bin/com/layouts/InsertData.class create mode 100644 Task1/bin/com/layouts/Menu.class create mode 100644 Task1/bin/com/layouts/ReadData.class create mode 100644 Task1/bin/com/layouts/UpdateData.class create mode 100644 Task1/bin/com/models/Produk.class create mode 100644 Task1/src/App.java create mode 100644 Task1/src/com/config/MyConfig.java create mode 100644 Task1/src/com/controller/controllerDB.java create mode 100644 Task1/src/com/layouts/DeleteData.java create mode 100644 Task1/src/com/layouts/InsertData.java create mode 100644 Task1/src/com/layouts/Menu.java create mode 100644 Task1/src/com/layouts/ReadData.java create mode 100644 Task1/src/com/layouts/UpdateData.java create mode 100644 Task1/src/com/models/Produk.java create mode 100644 Task2/.vscode/settings.json create mode 100644 Task2/build.xml create mode 100644 Task2/build/classes/.netbeans_automatic_build create mode 100644 Task2/build/classes/.netbeans_update_resources create mode 100644 Task2/build/classes/App$1.class create mode 100644 Task2/build/classes/App$2.class create mode 100644 Task2/build/classes/App$3.class create mode 100644 Task2/build/classes/App$4.class create mode 100644 Task2/build/classes/App$5.class create mode 100644 Task2/build/classes/App$6.class create mode 100644 Task2/build/classes/App$7.class create mode 100644 Task2/build/classes/App$8.class create mode 100644 Task2/build/classes/App.class create mode 100644 Task2/build/classes/App.form create mode 100644 Task2/manifest.mf create mode 100644 Task2/nbproject/build-impl.xml create mode 100644 Task2/nbproject/genfiles.properties create mode 100644 Task2/nbproject/private/private.properties create mode 100644 Task2/nbproject/private/private.xml create mode 100644 Task2/nbproject/project.properties create mode 100644 Task2/nbproject/project.xml create mode 100644 Task2/src/App.form create mode 100644 Task2/src/App.java diff --git a/Task1/.vscode/settings.json b/Task1/.vscode/settings.json new file mode 100644 index 0000000..718e504 --- /dev/null +++ b/Task1/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar", + "c:\\Program Files\\Java\\mysql-connector-j-8.0.32\\mysql-connector-j-8.0.32.jar" + ] +} diff --git a/Task1/README.md b/Task1/README.md new file mode 100644 index 0000000..95f3b55 --- /dev/null +++ b/Task1/README.md @@ -0,0 +1,20 @@ +- pada package com.config +terdapat method connection() yang bertanggung jawab untuk membuat koneksi ke database menggunakan JDBC (Java Database Connectivity). + + +- pada config com.controller +terdapat method getDatabase() yang bertanggung jawab untuk mengambil data dari tabel tb_produk dalam database. +terdapat method insertDB(String product, Long i, Integer stok) yang bertanggung jawab untuk untuk menyisipkan (insert) data baru ke dalam tabel tb_produk. +terdapat method updateNamaDB(int id, String name), updateHargaDB(int id, Long harga), dan updateStokDB(int id, Integer stok) yang bertanggung jawab untuk memperbarui data dalam tabel tb_produk berdasarkan ID dengan mengubah nilai NAMA, HARGA, dan JUMLAH masing-masing. +terdapat method deleteDB(String nama) yang bertanggung jawab untuk menghapus data dalam tabel tb_produk berdasarkan NAMA. +terdapat method getProdukbyNama(String nama) yang bertanggung jawab untuk mengambil data produk berdasarkan NAMA dari tabel tb_produk. + +- pada com.layouts +pada class DeleteData terdapat method showDeleteData() yang berfungsi untuk menghapus data. +pada class InsertData terdapat method showInsertData() yang berfungsi untuk menambahkan data baru. +pada class Menu terdapat method showMenu() yang berfungsi untuk menampilkan pilihan menu dan method SelectMenu() yang berfungsi untuk mengeksekusi angka menu yang diinput. +pada class ReadData terdapat method showReadData() yang berfungsi untuk menampilkan seluruh isi data. +pada class UpdateData terdapat method showUpdateData(String nama) yang bertanggung jawab untuk menampilkan menu pengeditan data produk dan method showEditNama(String nama), showEditHarga(String nama), dan showEditStok(String nama) ketiga metode ini bertanggung jawab untuk menampilkan menu dan menghandle pengeditan data nama, harga, dan jumlah (stok) produk. + +- pada com.models +terdapat method main method yang berfungsi menjalankan program tersebut. \ No newline at end of file diff --git a/Task1/bin/App.class b/Task1/bin/App.class new file mode 100644 index 0000000000000000000000000000000000000000..02667fba0809fb1cbf30f8f82007b39340a3c8ba GIT binary patch literal 450 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 P6ujl+{GU1Mz+e6YZ&}!m literal 0 HcmV?d00001 diff --git a/Task1/bin/com/layouts/DeleteData.class b/Task1/bin/com/layouts/DeleteData.class new file mode 100644 index 0000000000000000000000000000000000000000..24176af040009a793eab795dccf26007d2ed2081 GIT binary patch literal 1420 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 WbO$b||HuS#DuvZUqg@(x;N`!hwR1xN literal 0 HcmV?d00001 diff --git a/Task1/bin/com/layouts/ReadData.class b/Task1/bin/com/layouts/ReadData.class new file mode 100644 index 0000000000000000000000000000000000000000..43652ff6338e00c8741f27194b6458ad0caa16a3 GIT binary patch literal 1717 zcmb7EOK%%h6#lLo#}j)(-c4H5WJ*Yzq{OBLTF9d?shxJ}M@;-6f$|tnM#%(cCbGwn zvS7gii6u*xm5@@gYP(1ykg7^-5J)WG_we|xGZBtdDdmplo;mlNd+s;qyXXA+_m58i zEWnB&Brs@s+sT@F*K7KXeoUea)P zntsu*+vfIM6g?P`n9m4|Og__Psv=K_t9TLT_`gg~d$2;?agTy27!w$uIeA2J9^(s7#qIT_F-*A~D-V7s(IV?mlPj1>7&e?8L#dV28 zkqk>+!8-y|C+9BkP_QU4T-0*~-Oz5ADYQ&Fx2R{0L?RI-VJQ`9Eb(gEyAIKGOd2v} zw*(T;eMZYs!EJ$woUSh&re{sh-_%k@!N?l7w33n1Gg>LVQcR}|T|ri0^89m-CUcIg`=znvpM*OOync(X~Yi1tkIPq<@vvRaCqusR&y&uVF{9 zc62RU_bt6^**m`D@g9a67EOmm(q4fq)M&%5u`x&@1%$zuB_EXB@i27mF8ZeRY0lgU zx}7 zA6Mt&KQJK20$+(i#vkE3dVtwI+>tTf4)*AQlzRLCH}4AyW59}?+(p7Rkt=GP}&KZEdJSdXAbgh&73>4Kkf NT8-1eq(cbRe*q@hW%d97 literal 0 HcmV?d00001 diff --git a/Task1/bin/com/layouts/UpdateData.class b/Task1/bin/com/layouts/UpdateData.class new file mode 100644 index 0000000000000000000000000000000000000000..d6d7e6a33574cf8dfaef5dc595fac2dc998354b8 GIT binary patch literal 3893 zcmb7{`*##)8OOg9lFYCSBm`&*q&T6LCV?ac+G>Hs?q+k@T$YecLQ^d5WOqoGY-X3; z*+ANYLakz}^?tuAn%b%r)Fl?JR_m?S;}4!=f7IW4j{O_Fe4m-w&4vV|IcMj+&htLc z=ef+A*Z=eKD*!t17Znu>Zi}a9+f(LzI`8D#$1(}ivBIWfs;E>@d(xaUxoA(dAD%pE z#T^CJhmv;E=~S?$sd-#MWmh_31+WHdbyT5RLCs*&wxapjNh>>QPNpmcb%W`+nHo2< zNg4Z-mCkfBr{MO%)lWaDU_)*?eR@eB1zVa1m(+Ssk~bUO`3Drc6&{GTk1rGkJ$nEpzr@0JYdE_H3hu{;Ah( zX&#po8g$%&9b`dx<-&%kTv3u*=TSm zNTfl=*1pnYUvQ*XX1f@T`%AO^V?*>0r@MKsr}U6z=Y6FO(YhABI{FZyXGO<|%}8Qy zMFLPTpkq+%(IpqU6G=xbmW8N}!?LixxX@>2r`(kzI!2bg5_8fs8b;~=p zBpmT#W;7BG4j7}|BQeHGFo1D9q~a)zD^E?)TE~PqU6V6qEV>`l@qU@Cil@>N1IHB@ zZYmipBscJ(hQ}1N)0gk$PsL<0E!=w4eI{;YoMf6wTq)rqb!J6*V3z0Ne9c=auMZ4~ zK+a0Bq=_X86!KRX9DYGqegrqKk2z+1X2{IA^-IO<^1|X)BT1dKjtovQT$mYNWKPbD z(-hpjTKRIz-z-aLD#uipct5Ctb+N7E9sOyb2?00NUH_^$t)TvT9HD$Nm9VlJ=9#(f zzTnZ|pv2%Do{(}^6Tn$~K*c%6usDC2Vmdx3iKNmnFAC>yLB~`05Wfj#CS%zNrt+#b z-arqQ**Sbz$4A`!bkbf)*YMGzcA?hOPck#|?iWim z3Wu1%O_7yR&^)f;(+akRx<~qgOz~nKyTwvCX!tAxvQ(9BtwXcD3MKKif|grys8qW;foJ)HB{GXTe(n}Xl96&INUjNz zUkH-O&5*pZB(KQi*Z7T!SBsYhH`7^kttl%jSbpmUQMpKe(dF?w9lysPN?|9;2#)$? zIEpU_kw5V}x+)RRNU5fj;SmYM()n!M>PgD2sb=Zw(-o9l(vYmq5|wvp@$bxKO|F+_-8%p?Yd0C zPvLL)J4}ifRL|i~K6Rp6&pX`)9$3SfTI|9`UUTYjKW96!8C|Hy0B%PNTX78A5a-Sr zG$6-I;1k$EsXK9zZ(ia>?RmcaBAW0LnsJ4RRKOm_a2sBwzh1*$yn%iAEA~^5d+{dj z!#{Y+TfDsd3lF$1Ye6M-dYfk?*sjArVc`Tdzeo+HFij`FNv)DN$=(ci?11`jTvAc1 zR99CA{!7g(RHQhDqQcxnr}HA=JH3LkMf$lir<11b(#ra@9KZF)*DyCxcjhV{-&4So z1)MM7X@5h}#TPl2IEZq`Gp&pGxUeru`;@==Gi-hLEQM-_S^|e?WhZ+Nl5h|PLZsKl zUKkN{;|O|qG3mu|j!vK-HaX1Erg;qU`w%T-cCN%M=QFG2?$6=#BsET%Um#KbyCU}| zpGP%mR8fNqH{wSaG~hnUKT0MKk-`L-Jj~HCOyUv7!Et2qC?3aSoYmZ z=)BAr6(+nn`b?_)7&(74CO=t)$&;^2h&=Btf%I z5Xm%=B#GoCk<1WDib!UO#3rOP0i5D$md_kR#KDuu^ZGJZhU9z+$y^D^sZyBi#_K#` N4PpG55G(M;{{Y`;hrj>; literal 0 HcmV?d00001 diff --git a/Task1/bin/com/models/Produk.class b/Task1/bin/com/models/Produk.class new file mode 100644 index 0000000000000000000000000000000000000000..135e209181f4ba3af784c619058f9fad38e94994 GIT binary patch literal 1200 zcmZ{iPj3=Y6vfXQ1}JpwUy4AhwAI#OTFb_r%ErV9A=RV}`zf8!X@NQq!xFS-g-?Rd&ic79^(D+7ZvBuO@O5i1rXMHKdR>(WYtYAKP?Z9HJ-_31WC6?BGTth&b( z2*Ff1#4~;+*EC4sI}fHoiVH!W<0yIj0CGYrXFGg literal 0 HcmV?d00001 diff --git a/Task1/src/App.java b/Task1/src/App.java new file mode 100644 index 0000000..12004d0 --- /dev/null +++ b/Task1/src/App.java @@ -0,0 +1,9 @@ + +import com.layouts.Menu; +public class App { + public static void main(String[] args) throws Exception { + Menu.showMenu(); + } + + +} diff --git a/Task1/src/com/config/MyConfig.java b/Task1/src/com/config/MyConfig.java new file mode 100644 index 0000000..2c485bb --- /dev/null +++ b/Task1/src/com/config/MyConfig.java @@ -0,0 +1,456 @@ +package com.config; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +public class MyConfig { + + private static final String DB_URL = "jdbc:mysql://localhost:3306/db_produk"; + private static final String DB_USER = "root"; + private static final String DB_PASS = ""; + + protected static Connection connect; + protected static PreparedStatement preparedStatement; + protected static ResultSet resultSet; + protected static String query; + + public static void connection() { + try { + connect = DriverManager.getConnection(DB_URL, DB_USER, DB_PASS); + System.out.println("Sudah TerConnect database, Sukses"); + + } catch (SQLException e) { + e.printStackTrace(); + + + } + } + +} + +// jTable1 = new javax.swing.JTable(); + +// jTable1.setModel(new javax.swing.table.DefaultTableModel( +// new Object [][] { +// {null, null, null, null}, +// {null, null, null, null}, +// {null, null, null, null}, +// {null, null, null, null} +// }, +// new String [] { +// "Title 1", "Title 2", "Title 3", "Title 4" +// } +// )); + +// jScrollPane1.setViewportView(jTable1); + + +// import java.sql.Connection; +// import java.sql.DriverManager; +// import java.sql.PreparedStatement; +// import java.sql.ResultSet; +// import java.sql.SQLException; +// import java.sql.Statement; +// import javax.swing.table.DefaultTableModel; + +// public class App extends javax.swing.JFrame { +// private int totalBelanja = 0; +// /** +// * Creates new form App +// */ +// public App() { +// initComponents(); +// loadData(); +// } + +// private void loadData() { +// // Konfigurasi koneksi database +// String url = "jdbc:mysql://localhost:3306/db_produk"; +// String username = "root"; +// String password = ""; + +// // Koneksi ke database +// try (Connection conn = DriverManager.getConnection(url, username, password)) { +// // Statement untuk menjalankan query +// Statement stmt = conn.createStatement(); + +// // Query untuk mengambil data dari tabel +// String query = "SELECT * FROM tb_produk"; + +// // Eksekusi query dan ambil hasilnya +// ResultSet rs = stmt.executeQuery(query); + +// // Buat model tabel +// DefaultTableModel model = (DefaultTableModel) tabel.getModel(); + +// // Hapus semua baris yang ada di tabel +// model.setRowCount(0); + +// // Loop melalui hasil query dan tambahkan data ke dalam model tabel +// while (rs.next()) { +// int id = rs.getInt("ID"); +// String nama = rs.getString("Nama"); +// long harga = rs.getLong("Harga"); +// int jumlah = rs.getInt("jumlah"); + +// // Tambahkan data ke dalam baris baru pada model tabel +// model.addRow(new Object[]{id, nama, harga, jumlah}); +// } + +// // Tutup statement dan result set +// stmt.close(); +// rs.close(); +// } catch (SQLException e) { +// e.printStackTrace(); +// } +// } +// @SuppressWarnings("unchecked") +// // +// private void initComponents() { + +// jPanel1 = new javax.swing.JPanel(); +// jPanel2 = new javax.swing.JPanel(); +// jLabel1 = new javax.swing.JLabel(); +// jScrollPane1 = new javax.swing.JScrollPane(); +// tabel = new javax.swing.JTable(); +// jLabel2 = new javax.swing.JLabel(); +// jLabel3 = new javax.swing.JLabel(); +// jLabel4 = new javax.swing.JLabel(); +// textNama = new javax.swing.JTextField(); +// textHarga = new javax.swing.JTextField(); +// textJumlah = new javax.swing.JTextField(); +// buttonTambah = new javax.swing.JButton(); +// buttonHapus = new javax.swing.JButton(); +// buttonClear = new javax.swing.JButton(); +// jPanel3 = new javax.swing.JPanel(); +// jLabel5 = new javax.swing.JLabel(); +// jLabel6 = new javax.swing.JLabel(); +// jLabel7 = new javax.swing.JLabel(); +// textTotal = new javax.swing.JTextField(); +// textTunai = new javax.swing.JTextField(); +// textKembali = new javax.swing.JTextField(); +// buttonSimpan = new javax.swing.JButton(); +// buttonBayar = new javax.swing.JButton(); + +// setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + +// jPanel1.setBackground(new java.awt.Color(51, 51, 51)); + +// jPanel2.setBackground(new java.awt.Color(102, 102, 102)); +// jPanel2.setForeground(new java.awt.Color(51, 51, 51)); + +// jLabel1.setFont(new java.awt.Font("Comic Sans MS", 0, 18)); // NOI18N +// jLabel1.setForeground(new java.awt.Color(255, 255, 255)); +// jLabel1.setText("CASH-COMP"); + +// javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); +// jPanel2.setLayout(jPanel2Layout); +// jPanel2Layout.setHorizontalGroup( +// jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) +// .addGroup(jPanel2Layout.createSequentialGroup() +// .addContainerGap() +// .addComponent(jLabel1) +// .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) +// ); +// jPanel2Layout.setVerticalGroup( +// jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) +// .addGroup(jPanel2Layout.createSequentialGroup() +// .addContainerGap() +// .addComponent(jLabel1) +// .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) +// ); + +// tabel.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 [] { +// "ID", "NAMA", "HARGA", "JUMLAH" +// } +// ) { +// Class[] types = new Class [] { +// java.lang.Integer.class, java.lang.String.class, java.lang.Long.class, java.lang.Integer.class +// }; + +// public Class getColumnClass(int columnIndex) { +// return types [columnIndex]; +// } +// }); +// jScrollPane1.setViewportView(tabel); + +// jLabel2.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N +// jLabel2.setForeground(new java.awt.Color(255, 255, 255)); +// jLabel2.setText("Nama Barang"); + +// jLabel3.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N +// jLabel3.setForeground(new java.awt.Color(255, 255, 255)); +// jLabel3.setText("Harga Barang"); + +// jLabel4.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N +// jLabel4.setForeground(new java.awt.Color(255, 255, 255)); +// jLabel4.setText("Jumlah Barang"); + +// textNama.setBackground(new java.awt.Color(102, 102, 102)); +// textNama.setForeground(new java.awt.Color(255, 255, 255)); + +// textHarga.setBackground(new java.awt.Color(102, 102, 102)); +// textHarga.setForeground(new java.awt.Color(255, 255, 255)); + +// textJumlah.setBackground(new java.awt.Color(102, 102, 102)); +// textJumlah.setForeground(new java.awt.Color(255, 255, 255)); +// textJumlah.addActionListener(new java.awt.event.ActionListener() { +// public void actionPerformed(java.awt.event.ActionEvent evt) { +// textJumlahActionPerformed(evt); +// } +// }); + +// buttonTambah.setBackground(new java.awt.Color(102, 102, 102)); +// buttonTambah.setText("ADD"); +// buttonTambah.addActionListener(new java.awt.event.ActionListener() { +// public void actionPerformed(java.awt.event.ActionEvent evt) { +// buttonTambahActionPerformed(evt); +// } +// }); + +// buttonHapus.setBackground(new java.awt.Color(102, 102, 102)); +// buttonHapus.setText("DELETE"); +// buttonHapus.addActionListener(new java.awt.event.ActionListener() { +// public void actionPerformed(java.awt.event.ActionEvent evt) { +// buttonHapusActionPerformed(evt); +// } +// }); + +// buttonClear.setBackground(new java.awt.Color(153, 0, 0)); +// buttonClear.setText("CLEAR"); + +// jPanel3.setBackground(new java.awt.Color(153, 153, 153)); + +// jLabel5.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N +// jLabel5.setForeground(new java.awt.Color(255, 255, 255)); +// jLabel5.setText("Total"); + +// jLabel6.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N +// jLabel6.setForeground(new java.awt.Color(255, 255, 255)); +// jLabel6.setText("Cash"); + +// jLabel7.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N +// jLabel7.setForeground(new java.awt.Color(255, 255, 255)); +// jLabel7.setText("Change"); + +// textTotal.setBackground(new java.awt.Color(204, 204, 204)); + +// textTunai.setBackground(new java.awt.Color(204, 204, 204)); + +// textKembali.setBackground(new java.awt.Color(204, 204, 204)); + +// buttonSimpan.setBackground(new java.awt.Color(102, 102, 102)); +// buttonSimpan.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N +// buttonSimpan.setText("ADD TO CART"); + +// buttonBayar.setBackground(new java.awt.Color(102, 102, 102)); +// buttonBayar.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N +// buttonBayar.setText("PAY"); + +// javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); +// jPanel3.setLayout(jPanel3Layout); +// jPanel3Layout.setHorizontalGroup( +// jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) +// .addGroup(jPanel3Layout.createSequentialGroup() +// .addContainerGap() +// .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) +// .addGroup(jPanel3Layout.createSequentialGroup() +// .addComponent(jLabel7) +// .addGap(18, 18, 18) +// .addComponent(textKembali)) +// .addGroup(jPanel3Layout.createSequentialGroup() +// .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) +// .addComponent(jLabel5) +// .addComponent(jLabel6)) +// .addGap(35, 35, 35) +// .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) +// .addComponent(textTotal) +// .addComponent(textTunai))) +// .addGroup(jPanel3Layout.createSequentialGroup() +// .addComponent(buttonSimpan) +// .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) +// .addComponent(buttonBayar) +// .addGap(0, 43, Short.MAX_VALUE))) +// .addContainerGap()) +// ); +// jPanel3Layout.setVerticalGroup( +// jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) +// .addGroup(jPanel3Layout.createSequentialGroup() +// .addContainerGap() +// .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) +// .addComponent(jLabel5) +// .addComponent(textTotal, 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(jLabel6) +// .addComponent(textTunai, 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(jLabel7) +// .addComponent(textKembali, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) +// .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE) +// .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) +// .addComponent(buttonSimpan) +// .addComponent(buttonBayar)) +// .addContainerGap()) +// ); + +// javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); +// jPanel1.setLayout(jPanel1Layout); +// jPanel1Layout.setHorizontalGroup( +// jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) +// .addGroup(jPanel1Layout.createSequentialGroup() +// .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) +// .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) +// .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() +// .addContainerGap() +// .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) +// .addComponent(jScrollPane1) +// .addGroup(jPanel1Layout.createSequentialGroup() +// .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) +// .addGroup(jPanel1Layout.createSequentialGroup() +// .addComponent(buttonTambah, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE) +// .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) +// .addComponent(buttonHapus, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)) +// .addGroup(jPanel1Layout.createSequentialGroup() +// .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) +// .addComponent(jLabel2) +// .addComponent(jLabel3) +// .addComponent(jLabel4)) +// .addGap(25, 25, 25) +// .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) +// .addComponent(textNama, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE) +// .addComponent(textHarga) +// .addComponent(textJumlah))) +// .addComponent(buttonClear, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) +// .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) +// .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))) +// .addContainerGap(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.RELATED) +// .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE) +// .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) +// .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) +// .addGroup(jPanel1Layout.createSequentialGroup() +// .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) +// .addComponent(jLabel2) +// .addComponent(textNama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) +// .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) +// .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) +// .addComponent(jLabel3) +// .addComponent(textHarga, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) +// .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) +// .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) +// .addComponent(textJumlah, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) +// .addComponent(jLabel4)) +// .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) +// .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) +// .addComponent(buttonTambah) +// .addComponent(buttonHapus)) +// .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) +// .addComponent(buttonClear)) +// .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) +// .addGap(0, 3, Short.MAX_VALUE)) +// ); + +// 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.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) +// ); +// layout.setVerticalGroup( +// layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) +// .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) +// ); + +// pack(); +// setLocationRelativeTo(null); +// }// + +// private void textJumlahActionPerformed(java.awt.event.ActionEvent evt) { +// // TODO add your handling code here: +// } + +// private void buttonHapusActionPerformed(java.awt.event.ActionEvent evt) { +// // TODO add your handling code here: +// } + +// private void buttonTambahActionPerformed(java.awt.event.ActionEvent evt) { +// // TODO add your handling code here: +// } + +// /** +// * @param args the command line arguments +// */ +// public static void main(String args[]) { +// /* Set the Nimbus look and feel */ +// // +// /* 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(App.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); +// } catch (InstantiationException ex) { +// java.util.logging.Logger.getLogger(App.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); +// } catch (IllegalAccessException ex) { +// java.util.logging.Logger.getLogger(App.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); +// } catch (javax.swing.UnsupportedLookAndFeelException ex) { +// java.util.logging.Logger.getLogger(App.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); +// } +// // + +// /* Create and display the form */ +// java.awt.EventQueue.invokeLater(new Runnable() { +// public void run() { +// new App().setVisible(true); +// } +// }); +// } + +// // Variables declaration - do not modify +// private javax.swing.JButton buttonBayar; +// private javax.swing.JButton buttonClear; +// private javax.swing.JButton buttonHapus; +// private javax.swing.JButton buttonSimpan; +// private javax.swing.JButton buttonTambah; +// private javax.swing.JLabel jLabel1; +// private javax.swing.JLabel jLabel2; +// private javax.swing.JLabel jLabel3; +// private javax.swing.JLabel jLabel4; +// private javax.swing.JLabel jLabel5; +// private javax.swing.JLabel jLabel6; +// private javax.swing.JLabel jLabel7; +// private javax.swing.JPanel jPanel1; +// private javax.swing.JPanel jPanel2; +// private javax.swing.JPanel jPanel3; +// private javax.swing.JScrollPane jScrollPane1; +// private javax.swing.JTable tabel; +// private javax.swing.JTextField textHarga; +// private javax.swing.JTextField textJumlah; +// private javax.swing.JTextField textKembali; +// private javax.swing.JTextField textNama; +// private javax.swing.JTextField textTotal; +// private javax.swing.JTextField textTunai; +// // End of variables declaration +// } diff --git a/Task1/src/com/controller/controllerDB.java b/Task1/src/com/controller/controllerDB.java new file mode 100644 index 0000000..405538d --- /dev/null +++ b/Task1/src/com/controller/controllerDB.java @@ -0,0 +1,123 @@ +package com.controller; + +import java.sql.SQLException; + +import com.config.MyConfig; +import com.models.Produk; + +public class controllerDB extends MyConfig { + public static void getDatabase(){ + connection(); + + try { + String query = "SELECT NAMA, HARGA, JUMLAH FROM `tb_produk` ORDER BY ID DESC"; + preparedStatement = connect.prepareStatement(query); + resultSet = preparedStatement.executeQuery(); + + while (resultSet.next()){ + + + System.out.println( + resultSet.getString("NAMA")+", Rp."+ + resultSet.getInt("HARGA")+", stock = "+ + resultSet.getInt("JUMLAH")); + } + + preparedStatement.close(); + } catch (SQLException e) { + e.printStackTrace(); + + } + } + + public static boolean insertDB(String product, Long i, Integer stok) { + connection(); + query = "INSERT INTO `tb_produk` (NAMA, HARGA, JUMLAH) VALUES (?, ?, ?)"; + try { + preparedStatement = connect.prepareStatement(query); + preparedStatement.setString(1, product); + preparedStatement.setLong(2, i); + preparedStatement.setInt(3, stok); + preparedStatement.executeUpdate(); + preparedStatement.close(); + return true; + } catch (SQLException e) { + e.printStackTrace(); + + } + return false; + } + public static void updateNamaDB(int id, String name) { + connection(); + query= "UPDATE `tb_produk` SET NAMA=? WHERE ID=?"; + try { + preparedStatement = connect.prepareStatement(query); + preparedStatement.setString(1, name); + preparedStatement.setInt(2, id); + preparedStatement.executeUpdate(); + preparedStatement.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + public static void updateHargaDB(int id, Long harga) { + connection(); + query= "UPDATE `tb_produk` SET HARGA=? WHERE ID=?"; + try { + preparedStatement = connect.prepareStatement(query); + preparedStatement.setLong(1, harga); + preparedStatement.setInt(2, id); + preparedStatement.executeUpdate(); + preparedStatement.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + public static void updateStokDB(int id, Integer stok) { + connection(); + query= "UPDATE `tb_produk` SET JUMLAH=? WHERE ID=?"; + try { + preparedStatement = connect.prepareStatement(query); + preparedStatement.setInt(1, stok); + preparedStatement.setInt(2, id); + preparedStatement.executeUpdate(); + preparedStatement.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + public static boolean deletDB(String nama) { + connection(); + query= "DELETE FROM `tb_produk` WHERE NAMA=?"; + try { + preparedStatement = connect.prepareStatement(query); + preparedStatement.setString(1, nama); + int rowDelete = preparedStatement.executeUpdate(); + if (rowDelete>0) { + return true; + } + preparedStatement.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + return false; + } + public static Produk getProdukbyNama(String nama){ + Produk produk = null; + connection(); + query = "SELECT * FROM `tb_produk` WHERE NAMA=?"; + try { + preparedStatement = connect.prepareStatement(query); + preparedStatement.setString(1, nama); + resultSet = preparedStatement.executeQuery(); + + while (resultSet.next()) { + produk = new Produk(resultSet.getInt("ID"), resultSet.getString("NAMA"), resultSet.getLong("HARGA"), resultSet.getInt("JUMLAH")); + } + preparedStatement.close(); + } catch (Exception e) { + e.printStackTrace(); + } + return produk; + } +} diff --git a/Task1/src/com/layouts/DeleteData.java b/Task1/src/com/layouts/DeleteData.java new file mode 100644 index 0000000..32432b7 --- /dev/null +++ b/Task1/src/com/layouts/DeleteData.java @@ -0,0 +1,35 @@ +package com.layouts; + +import java.util.Scanner; + +import com.controller.controllerDB; + +public class DeleteData { + public static void showDeleteData(){ + Scanner sc = new Scanner(System.in); + System.out.println("---------------------------------------------"); + System.out.println("SILAHKAN PILIH DATA YANG INGIN DIHAPUS "); + System.out.println("---------------------------------------------"); + controllerDB.getDatabase(); + System.out.println("---------------------------------------------"); + System.out.println("***Catatan: input nama produk dengan benar!!!"); + System.out.print("Pilih Nama Produk: "); + String nama = sc.nextLine(); + System.out.println("---------------------------------------------"); + + if (controllerDB.deletDB(nama)) { + System.out.println("BERHASIL MENGHAPUS DATA"); + + }else{ + System.out.println("GAGAL MENGHAPUS DATA"); + System.out.println("----------------------------------------------"); + DeleteData.showDeleteData(); + + } + + System.out.println("----------------------------------------------"); + Menu.showMenu(); + sc.close(); + } + +} diff --git a/Task1/src/com/layouts/InsertData.java b/Task1/src/com/layouts/InsertData.java new file mode 100644 index 0000000..1d9bd24 --- /dev/null +++ b/Task1/src/com/layouts/InsertData.java @@ -0,0 +1,35 @@ +package com.layouts; + +import java.util.Scanner; + +import com.controller.controllerDB; + +public class InsertData { + public static void showInsertData(){ + try { + Scanner sc = new Scanner(System.in); + System.out.println("------------------------------------"); + System.out.println("SILAHKAN INPUT PRODUK"); + System.out.println("------------------------------------"); + System.out.println("NAMA"); + String name = sc.nextLine(); + System.out.println("HARGA"); + long harga = sc.nextInt(); + System.out.println("STOK"); + int stok = sc.nextInt(); + System.out.println("------------------------------------"); + if (controllerDB.insertDB(name, harga, stok)) { + System.out.println("BERHASIL INSERT DATA"); + + }else{ + System.out.println("GAGAL MENAMBAHKAN DATA"); + } + System.out.println("------------------------------------"); + Menu.showMenu(); + sc.close(); + + } catch (Exception e) { + InsertData.showInsertData(); + } + } +} diff --git a/Task1/src/com/layouts/Menu.java b/Task1/src/com/layouts/Menu.java new file mode 100644 index 0000000..811eec0 --- /dev/null +++ b/Task1/src/com/layouts/Menu.java @@ -0,0 +1,59 @@ +package com.layouts; + +import java.util.Scanner; + + +public class Menu{ + public static void showMenu(){ + System.out.println("----------------------------------------"); + System.out.println("------------ SELAMAT DATANG ------------"); + System.out.println("----------------------------------------"); + System.out.println("1] READ DATA "); + System.out.println("2] INSERT DATA "); + System.out.println("3] EDIT DATA "); + System.out.println("4] DELETE DATA "); + System.out.println("5] EXIT "); + System.out.println("-----------------------------------------"); + System.out.print("PILIH: "); + SelectMenu(); + } + public static void SelectMenu(){ + Scanner sc = new Scanner(System.in); + try { + + int menu = sc.nextInt(); + switch (menu) { + case 1: + ReadData.showReadData(); + break; + case 2: + InsertData.showInsertData(); + break; + case 3: + UpdateData.showUpdateData(null); + break; + case 4: + DeleteData.showDeleteData(); + break; + case 5: + System.out.println("------------------------------------------"); + System.out.println("TERIMA KASIH DAN SAMPAI JUMPA"); + System.out.println("------------------------------------------"); + break; + + default: + System.out.println("MAAF MENU TIDAK ADA DIPILIHAN"); + Menu.showMenu(); + break; + + } + sc.close(); + } catch (Exception e) { + System.out.println("INPUTAN BERUPA ANGKA"); + showMenu(); + } + + + } +} + diff --git a/Task1/src/com/layouts/ReadData.java b/Task1/src/com/layouts/ReadData.java new file mode 100644 index 0000000..67569c3 --- /dev/null +++ b/Task1/src/com/layouts/ReadData.java @@ -0,0 +1,58 @@ +package com.layouts; + +import java.util.Scanner; + +import com.controller.controllerDB; + +public class ReadData { + + + public static void showReadData(){ + Scanner sc = new Scanner(System.in); + + System.out.println("-----------------------------------"); + System.out.println("DATA PRODUK"); + System.out.println("-----------------------------------"); + controllerDB.getDatabase(); + System.out.println("-----------------------------------"); + + System.out.println("1. MENU "); + System.out.println("2. EXIT "); + System.out.print("Pilih bang: "); + try { + int selectMenu = sc.nextInt(); + switch (selectMenu) { + case 1: + Menu.showMenu(); + break; + case 2: + System.out.println("-----------------------------------------"); + System.out.println("SAMPAI JUMPA KEMBALI..."); + System.out.println("-----------------------------------------"); + System.exit(selectMenu); + break; + + default: + System.out.println("----------------------------------------------"); + System.out.println("MAAF MENU YANG DIPILIH TIDAK TERSEDIA"); + System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + ReadData.showReadData(); + break; + } + + } catch (Exception e) { + System.out.println("=============================================="); + System.out.println("MASUKKAN INPUTAN ANGKA BANG"); + System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + ReadData.showReadData(); + } + + + + + System.out.println("--------------------------------"); + Menu.showMenu(); + sc.close(); + } + +} diff --git a/Task1/src/com/layouts/UpdateData.java b/Task1/src/com/layouts/UpdateData.java new file mode 100644 index 0000000..eb6b85f --- /dev/null +++ b/Task1/src/com/layouts/UpdateData.java @@ -0,0 +1,123 @@ +package com.layouts; + +import java.util.Scanner; + +import com.controller.controllerDB; +import com.models.Produk; + +public class UpdateData { + //private String nama; + + public static void showUpdateData(String nama){ + Scanner sc = new Scanner(System.in); + System.out.println("=------------------------------------"); + System.out.println("SILAHKAN PILIH DATA YANG INGIN DIEDIT "); + System.out.println("-------------------------------------"); + controllerDB.getDatabase(); + System.out.println("----------------------------------------------"); + System.out.println("***Catatan: input nama produk dengan benar!!!"); + System.out.print("Pilih Nama Produk: "); + nama = sc.nextLine(); + //ControllerDB.getProdukbyNama(selectData); + + System.out.println("----------------------------------------------"); + System.out.println("SILAHKAN UPDATE PRODUK"); + System.out.println("----------------------------------------------"); + System.out.println("1. UPDATE NAMA "); + System.out.println("2. UPDATE HARGA "); + System.out.println("3. UPDATE JUMLAH "); + System.out.println("----------------------------------------------"); + System.out.print("Pilih Menu Produk : "); + + try { + + int selectMenu = sc.nextInt(); + switch (selectMenu) { + case 1: + showEditNama(nama); + break; + case 2: + showEditHarga(nama); + break; + case 3: + showEditStok(nama); + break; + default: + System.out.println("MAAF NAMA YANG DIPILIH TIDAK TERSEDIA"); + Menu.showMenu(); + } + System.out.println("----------------------------------------------"); + Menu.showMenu(); + sc.close(); + } catch (Exception e) { + System.out.println("Input data produk dengan benar!!"); + System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + Menu.showMenu(); + } + } + + public static void showEditNama(String nama){ + Scanner sc = new Scanner(System.in); + + Produk produk = controllerDB.getProdukbyNama(nama); + + System.out.println("=============================================="); + System.out.println("EDIT NAMA "); + System.out.println("=============================================="); + System.out.println( "NAMA AWAL: "+ produk.getNama()); + System.out.println("----------------------------------------------"); + System.out.println("NAMA BARU: "); + String namaBaru = sc.nextLine(); + controllerDB.updateNamaDB(produk.getId(), namaBaru); + + System.out.println("=============================================="); + System.out.println("BERHASIL UPDATE DATA NAMA"); + System.out.println("-----------------------------------------------"); + Menu.showMenu(); + sc.close(); + } + + public static void showEditHarga(String nama){ + Scanner sc = new Scanner(System.in); + + Produk produk = controllerDB.getProdukbyNama(nama); + System.out.println("=============================================="); + System.out.println("EDIT HARGA "); + System.out.println("=============================================="); + System.out.println( "HARGA AWAL: "+ produk.getHarga()); + System.out.println("----------------------------------------------"); + System.out.println("HARGA BARU: "); + long hargaBaru = sc.nextInt(); + controllerDB.updateHargaDB(produk.getId(), hargaBaru); + + System.out.println("=============================================="); + System.out.println("BERHASIL UPDATE DATA HARGA"); + System.out.println("----------------------------------------------"); + Menu.showMenu(); + sc.close(); + } + public static void showEditStok(String nama){ + Scanner sc = new Scanner(System.in); + + Produk produk = controllerDB.getProdukbyNama(nama); + + System.out.println("=============================================="); + System.out.println("EDIT JUMLAH "); + System.out.println("=============================================="); + System.out.println( "JUMLAH AWAL: "+ produk.getStok()); + System.out.println("----------------------------------------------"); + System.out.println("JUMLAH BARU: "); + int stokBaru = sc.nextInt(); + controllerDB.updateStokDB(produk.getId(), stokBaru); + + System.out.println("=============================================="); + System.out.println("BERHASIL UPDATE DATA JUMLAH"); + System.out.println("----------------------------------------------"); + Menu.showMenu(); + sc.close(); + } + + +} + + diff --git a/Task1/src/com/models/Produk.java b/Task1/src/com/models/Produk.java new file mode 100644 index 0000000..b8ad4e1 --- /dev/null +++ b/Task1/src/com/models/Produk.java @@ -0,0 +1,40 @@ +package com.models; + +public class Produk { + private int id; + private String nama; + private long harga; + private int stok; + + public Produk(int id, String nama, long harga, int stok) { + this.id = id; + this.nama = nama; + this.harga = harga; + this.stok = stok; + } + public int getId() { + return id; + } + public void setId(int id) { + this.id = id; + } + public String getNama() { + return nama; + } + public void setNama(String nama) { + this.nama = nama; + } + public long getHarga() { + return harga; + } + public void setHarga(long harga) { + this.harga = harga; + } + public int getStok() { + return stok; + } + public void setStok(int stok) { + this.stok = stok; + } + +} diff --git a/Task2/.vscode/settings.json b/Task2/.vscode/settings.json new file mode 100644 index 0000000..acd2672 --- /dev/null +++ b/Task2/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "java.project.referencedLibraries": [ + "lib/**/*.jar", + "c:\\Program Files\\Java\\mysql-connector-j-8.0.32\\mysql-connector-j-8.0.32.jar" + ] +} \ No newline at end of file diff --git a/Task2/build.xml b/Task2/build.xml new file mode 100644 index 0000000..48d135b --- /dev/null +++ b/Task2/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project AplikasiKasir. + + + diff --git a/Task2/build/classes/.netbeans_automatic_build b/Task2/build/classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29 diff --git a/Task2/build/classes/.netbeans_update_resources b/Task2/build/classes/.netbeans_update_resources new file mode 100644 index 0000000..e69de29 diff --git a/Task2/build/classes/App$1.class b/Task2/build/classes/App$1.class new file mode 100644 index 0000000000000000000000000000000000000000..adae9c7220d165789333a8961027190bff769cd7 GIT binary patch literal 944 zcma)4U2hUW6g|V&wm>PRAAVG=wWtfUrR^(fVo)OqMH5UD(x)wqbem<(Jr>WjZe z6B`o~{Q>?c2O%w7f7j7 zH!AKCXcDQVF^72z=`1qH3T&M@@0{~$^xpORRpp#`vieNEbw-|gql3esCp~gJa(!1l z5h&Zo$4z~t>Nz~{>f}szRqYC>bYvkXusF@FdrlNt$O|k@!G^D7UxpS60{JQ2Rw4aZ zSP{rg(PrTHb&+dXT*Gx1q&^H~Bv6>uH!?MWs%^^sZ@U7CI*X;{rt8brXmBD!(*p80 zgRbKpIiagtG6561tpb)-DehA+(Q}j|uyU26K&Bgbqk-RY2HNrRtm8=&*?>c-PJ`ZS zCuEkAAro_bsp{sWsf+Y>qcn2?f2*C)H~gMF7Z44BbUPS@UHQWGSkoL$?&?Oeyyt$` z3nI36tY%?bAkO_Pc2T9GzUg`}7zV!d6)nW=(h(V2GEy&tNC{*czArzp7g;PGOWWKf{rlDg$sMXV(YaJ-t5yMa?ZMXVA&zu9 z*NTi&TlYxh=84X!Q}9%g%~8VhT;#Y#_vV7(5?C18yQAwY(Yt{w6gMe5plA`lxAzIG z_XW;}f^(JD8tnw$;u@`+D;BnJohsrNY793huhI|jCM5DUnrqqNTGs1*1l#+J3%^zU vLg^jN_5KfK@0YTN7H*Q*TDe6HD%hd5M0Rc$RULQGE|5CzQuK*#P0;fbq92J} literal 0 HcmV?d00001 diff --git a/Task2/build/classes/App$3.class b/Task2/build/classes/App$3.class new file mode 100644 index 0000000000000000000000000000000000000000..acd534e077951a1c55467fe6505e5f2086e0ed70 GIT binary patch literal 2682 zcmaJ?S#ujj5dKD%yt1@%977xg0YnHOnScU@1f+17#7Sgi$Hb1q5stAmSaKw-vb(Y! z?)yH&%{v7Y6h{cg<}3n)g5r%AswjBi34Q`Ez&E?LY_N+eX}7m$y8D~%uY11#>*LP> zT!vTM5I~E8potJ#1wy^``i35XR<~4kHf*9IPfa$0Fxm`6OhjP{bWF%enXbs%czXBP zgetf+*jlcY-OB}9lBv-)v}2Wl4il@#rBGwq_GO-pX33RQzO~4peuC@|5F`4q5`Dlh+n;x?|{>dgz(ZSnv*j>^dms)$O ziPN+;qP6{vYDJbJNZrI@A4Fc_pXUki)aXP3=+flx}Cb>LVsy~9WagKqci4?j8 zRxf(U)m$~MY#!co!cTz}edNN}C~($9ajcN39&!#=GU;^1D#%L7a@AfhzoU?Pbz3o)YS@*osw$n(O)H#Z3C1Dc zpxCs?MsX#24P0en8@3Ca+zhmAE35A)*Jl+oo6N0{jZy7xhl!ooMPhQhPnA$I*Prs% z`b}JoJX?fo9s{_P^Opuq?8cBlOiimo!&Q6hMIOs*qMUZS$HcI1xKN>DIZAiOUK69( z=LhmTU`0NSMo9MSOkA(6!xc*ww@X**4DT^;<3e)14jw7l)|4Ep(EWbgY~mKMLu0a7 z9B$N^Y{yYWcI?s|H!ZTMQ3C~1x|zY@Yw~^51y$D!i(m}O#H|{_syZ8!iIjx{BepE4 zFiOnlPB|_s306^7$7Jb%tR;AS8Nmb&7^s-2f;3&Loi}I2ZqN0QtT9Wgosu;*K!oJ? z_Oh&4?AFvgP&wt2oz=QkBS*4J%H|I&4>^a@sUC8@Sxs_dy4UNCeA#hT&FkBwH~&(j z?6_@KkwI7G%QZFFsE#RnL}yK)Gp`$URN7_zJ+BPv0m?FI^9?;&5_dqkC960jZCO>W zvbnfQdeMfIeXC_xb(&9Kf_^EWJ`IkT$%KOqWgpT(J>*^m=cgVQ>yBGxN38P~b?+>r zG@%3woC2)c;;toqEFgHMwTo*@OG@JwHMtn!zlrm4G6E|~7KKZC?h+pR$nSbj4tZ(@ z>St5k)`OX=@#SV;g`w8OPaRr`ciAsh$RaTD#zW$nJi%DI7;np6(Up) z?~nlRNC69?qeI`Nyj}zRM{$sEo6_ZcYfYs4+z%nTKZ5bTx5weLm6pJ3aQW==ccFnv ze(CY9y$MWF4zb4fbns&uhkUnzDFoT-z#rX5A&w$8gA)dPF-~#N7uQkD1kanr>03ha z;4IGCY;>NR33r~CY3od9BJps%EgqT01(|5)mW&yX#?3ig8bBr%j|Df*;ffZ-W1+6l z9QuNkTGtqJ$Z6di1_bu$_ca3Z06Nn%7@0?~L|)gFXK-yidK}&H=p1ekcpV8H@;JJh z3X_4&IFE8u-2CEobY!CO=nRUYb9@%%_tAnKcpIN^Tph!A_<`>%e!|ZjH!aZFtnuat z{YLQyv-u|0<1HjnZ39I7BOavGLfqftAxc4_{}K=55i%i-kMSrTgTa%` z;Bl^od7dM9f>Ik#^$th_@H literal 0 HcmV?d00001 diff --git a/Task2/build/classes/App$4.class b/Task2/build/classes/App$4.class new file mode 100644 index 0000000000000000000000000000000000000000..8fa6c1631c1606fe5a16de996c7c7ee6647bfc24 GIT binary patch literal 2713 zcma)8TWlLe6g}hE*^RwTLZA;r3T~T1k^(NY6tHQaObJ@;|$ z+}Y3m{_rCJJMmH*B52VNH4sCqKx|jF+Ou7t)t@eVJzKd@;7T?Q9c>!o1`;p?I%mu| zGi{mnRQkZgj4b+8xS?#9{Q-fN-oEiRw4*~qr-Ad(#U(-z$u}pYC2&DOX&*^@^JVJa zGGq%^aeN(@2_TL>^lR8+;Bs6+X99zSNDsN?Iq43Y zwn?i3tLXBeW7`a>?AQXsy-hBU`YuzH{XZ-9NR@>pxNHJxY}Ig;fvd4i;QWRcOELl- zMOT`>9Q8R=q#dNL39hl8?PA4TV_*la6DW=Ja1(ZsDQ0ijDXFST^@ct# z))kA*lIfth0tpg7D6pxyu0oL^Ice4`e@QZq-N+f(gPR4~Tv>7EWKeBU1~#tZ$Q!st zoq|}=ay+SWoYyeCnBL%2j7_`Fyz(H90uC5Bh+7$-St^azs#RBdo-7HhYmTp>k?kAT zFv{o~WR2ch$Q>!ls;ZDUMsS;fab>@w%JT4;z~bzfYZj%3+XdDKYUaG3mUARCy(=iJ zLfP}BtqM->4GwhQILmdAsUu9GY|H(%%7k=-B#@ngs`7EuEvpdfi&51P1T>}Ivpvfu zFf9FPr*zPC&5HD;%gqimuy#k1ph9#(~; zNO`rn;Ol}R=w8zq%IL>UX`rjRInc~>ds$4<*t|t1!8!Fp;7t|pJP0JcB`!cKJ zS%Hm1xk7F%m)bLOU^wM3Hult^y}6NGDnFFknG!6aJbSe}Xpv&+X?R}U4~@HUnP2AUoe4Rq7z?X6TZe}_y$|> zEhWFB_V*aX57>tv*;{|2&d->^FR0>I;{HbD?}+yY5r4zm_#N-y&mg@|VHM?CF@Ykn z2N`e)lGN?vwLgg|v=MCsrcq|%GaP3y3yladSg3He3CCe`y@lQ!gF}rdeR_g+rzn%= z={(GtqW@Hb!c%bJk+lRp@~Im^jr&KTouyhrLqx-z5E_mw{--ru&pC_YELKBbNdlBF zoMmeGk++h5ArR32LS(mwk+bxur7lR*^;&W{jo|@~5j=>8_>A&1@L@a}thD1XK2=da W&fhb5j&EI*R7I@*j^hQqh~z)l-m~Ta literal 0 HcmV?d00001 diff --git a/Task2/build/classes/App$5.class b/Task2/build/classes/App$5.class new file mode 100644 index 0000000000000000000000000000000000000000..2e0bc72a7c523d384f139f782dbb65036364b1c2 GIT binary patch literal 861 zcmZuvTTc@~6#k}cyW3@LYn56RM4{ETAd8niRY^z#0a7aor0>&qq)YbF>`n`h{v{LC z#0P(XzsGoaF`n6Ngcvs2nKR#<%lDl*-~N303g9)GS)?$hL$i=Zh9SK@9#@(S898#I z$|eCFLRuyaWObMp=3y}uPWhDEF85FDxBXKwkQDIB@g2FvFjuShvdAH?qhR4CiUd&# z21AN-+2tN*D0ftXb2~b7D8<1sUFU2JqE2E3=6#otVka1Ix5qwiK!iW~`~)`}^~Urf|r??x(*f=M_K zyN;q~5Q7aRlM3$m12>4MSqT{n&(-VZ)JwJlZyfkkhKLzm5y`zEqDt1jPmO51Jc>j_ zJxtMHFgyY)6x0CGOr_|b$13d=vbJbfh}l^C2-f%v{X^_ir8Ps5z;`^RwUl__32Jmw zBcQS|)X7fM6uvLep@FqoS}{voZCrp|;70M*CoClP{VVo^*uJb-ghu&(z`{?I@rxM# pzEZvVuX+{hczRiVoq{xM(3*mc&G?kVGrWkA9A46HlDiU0-(Nk;vn>Ds literal 0 HcmV?d00001 diff --git a/Task2/build/classes/App$6.class b/Task2/build/classes/App$6.class new file mode 100644 index 0000000000000000000000000000000000000000..aaadca4f606bd0fbbedfdc51fa8756755e4dc09d GIT binary patch literal 3068 zcmaJ@`*R!B75=UsURhelM!|6uVo)2C*d~eGrkF$`rha0B?HJ2ZN@z>h(v7{gw5#l{ z{Ai)2B{Y3PUqGNO&?ofW(BQ@l)9LibPXCC`beMr3%74((@2(_U#x9y!?cICN`+Vn| z`}hC8`4<3Z@uy}45Y!OT5k`|hc(7dV>KAD87EQOSj~kQR$wU!BvxcaS7<7TQC1b@% z6%A`4b#8u1<~=gpYg(o^AQ0^C$u(miS~axkxCL=;Q3NG<#=I;F+&Zba*HZ4PN&W}s zjQOIZf?Lt9;ed_~92AJ}CK1@TAibp9C_0hU@e!pwVp>%(YV(MWF5D@gtti3gF8P8R<<;z1s?!mW$vnfjgH9^Z9gX-Mw5)r&2{bZxk18*Gr!|)z_aY%s*Oo z>_TNZf)fHE$F{u)QUZwLWB9m+Q#w9@yJ?Z{4n?F!9CJlFQ-)>GCxI3QWZ1SWhRn1r zfvHAQvYx{PWEzb7zdJR5m4aY>D6sbW=H3eOO;a5SWKQx-j}>E zJ~}&^Gz;n@hBHWO$mqBiX9f0e*}W~5;3_+^Y&bIO8J;Xji@EIE!|n!~W~vN@EsjhK z_u-Qo26YT!Sm4l>qFtm!E|bM15}*n(ImJ4vV@x5TMXt$w#gpgD1=^xc#&t}n3JB+m zw#%I}7;nZTrZi0JIER@XwUJ$S=>c(SS17){8fnu`%`osDgDs5`gE&jLXFYp4Id3?u zsN}Nk+SWo8b2zUdr{e-XRS(rpUV^f$Bo&$2_PrvMQ)PQm$0PVOQSI5){IUYO8v$I) zdK90w(&1sN;cJ_b&L!I^$%4QgwFrICpiyO9Mp+RsNfxX)%wl|ZC!xU=S2`9|a9K87 zchz>t5Y0CZ0K+7(;$R5qTqg zXhFv|cVkw_7?dll(3``nr5yM8Ym^D4gzW7^0V77cRDcDISIK!ObA^{{_4S!H`bL$4O zL-|gtHCz|C{liI#nyQOP@+uU8z!xFf+SGN3-6y~&h9~&`GFJn9tDR`?U2j12{u$bJ zpXMw4Zz3neemu$bfhrZQ;3dAZ=Ls?(!&%HS4de<#EzAt$ z;FUa};YaLS8rDN~;9MhF7%%ZZfS2(K-yx3FpWtWy&OZE{Z-wAr@c9jX$FDdk6=K!z K_xK}TN8*3j5hL;d literal 0 HcmV?d00001 diff --git a/Task2/build/classes/App$7.class b/Task2/build/classes/App$7.class new file mode 100644 index 0000000000000000000000000000000000000000..00ec9e70d92518e0d416d1f0d4272612b5a6e3a4 GIT binary patch literal 1820 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 + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="12" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Nama Barang"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="12" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Harga Barang"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="12" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Jumlah Barang"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textNama"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textHarga"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textJumlah"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="textJumlahActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="buttonTambah"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="ADD"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonTambahActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="buttonHapus"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="DELETE"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonHapusActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="buttonClear"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="0" red="99" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="CLEAR"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonClearActionPerformed"/> + </Events> + </Component> + <Container class="javax.swing.JPanel" name="jPanel3"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="99" green="99" red="99" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="textKembali" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="textTotal" max="32767" attributes="0"/> + <Component id="textTunai" max="32767" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="buttonSimpan" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="buttonBayar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="43" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="textTotal" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="textTunai" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="textKembali" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="34" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="buttonSimpan" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="buttonBayar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Total"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Cash"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Change"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textTotal"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textTunai"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textKembali"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="buttonSimpan"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="ADD TO CART"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="buttonBayar"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="PAY"/> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/Task2/manifest.mf b/Task2/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/Task2/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/Task2/nbproject/build-impl.xml b/Task2/nbproject/build-impl.xml new file mode 100644 index 0000000..a07447b --- /dev/null +++ b/Task2/nbproject/build-impl.xml @@ -0,0 +1,1771 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +*** GENERATED FROM project.xml - DO NOT EDIT *** +*** EDIT ../build.xml INSTEAD *** + +For the purpose of easier reading the script +is divided into following sections: + + - initialization + - compilation + - jar + - execution + - debugging + - javadoc + - test compilation + - test execution + - test debugging + - applet + - cleanup + + --> +<project xmlns:if="ant:if" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" xmlns:unless="ant:unless" basedir=".." default="default" name="AplikasiKasir-impl"> + <fail message="Please build using Ant 1.8.0 or higher."> + <condition> + <not> + <antversion atleast="1.8.0"/> + </not> + </condition> + </fail> + <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/> + <!-- + ====================== + INITIALIZATION SECTION + ====================== + --> + <target name="-pre-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-pre-init" name="-init-private"> + <property file="nbproject/private/config.properties"/> + <property file="nbproject/private/configs/${config}.properties"/> + <property file="nbproject/private/private.properties"/> + </target> + <target depends="-pre-init,-init-private" name="-init-user"> + <property file="${user.properties.file}"/> + <!-- The two properties below are usually overridden --> + <!-- by the active platform. Just a fallback. --> + <property name="default.javac.source" value="1.8"/> + <property name="default.javac.target" value="1.8"/> + </target> + <target depends="-pre-init,-init-private,-init-user" name="-init-project"> + <property file="nbproject/configs/${config}.properties"/> + <property file="nbproject/project.properties"/> + </target> + <target name="-init-modules-supported"> + <condition property="modules.supported.internal" value="true"> + <not> + <matches pattern="1\.[0-8](\..*)?" string="${javac.source}"/> + </not> + </condition> + </target> + <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-modulename"> + <macrodef name="modulename" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute name="property"/> + <attribute name="sourcepath"/> + <sequential> + <loadresource property="@{property}" quiet="true"> + <javaresource classpath="@{sourcepath}" name="module-info.java" parentFirst="false"/> + <filterchain> + <stripjavacomments/> + <linecontainsregexp> + <regexp pattern="module .* \{"/> + </linecontainsregexp> + <tokenfilter> + <linetokenizer/> + <replaceregex flags="s" pattern="(\s*module\s+)(\S*)(\s*\{.*)" replace="\2"/> + </tokenfilter> + <striplinebreaks/> + </filterchain> + </loadresource> + </sequential> + </macrodef> + </target> + <target depends="-init-modules-supported,-init-macrodef-modulename" if="modules.supported.internal" name="-init-source-module-properties"> + <fail message="Java 9 support requires Ant 1.10.0 or higher."> + <condition> + <not> + <antversion atleast="1.10.0"/> + </not> + </condition> + </fail> + <j2seproject3:modulename property="module.name" sourcepath="${src.dir}"/> + <condition property="named.module.internal"> + <and> + <isset property="module.name"/> + <length length="0" string="${module.name}" when="greater"/> + </and> + </condition> + <condition property="unnamed.module.internal"> + <not> + <isset property="named.module.internal"/> + </not> + </condition> + <property name="javac.modulepath" value=""/> + <property name="run.modulepath" value="${javac.modulepath}"/> + <property name="module.build.classes.dir" value="${build.classes.dir}"/> + <property name="debug.modulepath" value="${run.modulepath}"/> + <property name="javac.upgrademodulepath" value=""/> + <property name="run.upgrademodulepath" value="${javac.upgrademodulepath}"/> + <condition else="" property="javac.systemmodulepath.cmd.line.arg" value="--system '${javac.systemmodulepath}'"> + <and> + <isset property="javac.systemmodulepath"/> + <length length="0" string="${javac.systemmodulepath}" when="greater"/> + </and> + </condition> + <property name="dist.jlink.dir" value="${dist.dir}/jlink"/> + <property name="dist.jlink.output" value="${dist.jlink.dir}/${application.title}"/> + <property name="module.name" value=""/> + </target> + <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init"> + <property name="platform.java" value="${java.home}/bin/java"/> + <available file="${manifest.file}" property="manifest.available"/> + <condition property="splashscreen.available"> + <and> + <not> + <equals arg1="${application.splash}" arg2="" trim="true"/> + </not> + <available file="${application.splash}"/> + </and> + </condition> + <condition property="main.class.available"> + <and> + <isset property="main.class"/> + <not> + <equals arg1="${main.class}" arg2="" trim="true"/> + </not> + </and> + </condition> + <condition property="profile.available"> + <and> + <isset property="javac.profile"/> + <length length="0" string="${javac.profile}" when="greater"/> + <not> + <matches pattern="1\.[0-7](\..*)?" string="${javac.source}"/> + </not> + </and> + </condition> + <condition property="do.archive"> + <or> + <not> + <istrue value="${jar.archive.disabled}"/> + </not> + <istrue value="${not.archive.disabled}"/> + </or> + </condition> + <condition property="do.archive+manifest.available"> + <and> + <isset property="manifest.available"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="do.archive+main.class.available"> + <and> + <isset property="main.class.available"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="do.archive+splashscreen.available"> + <and> + <isset property="splashscreen.available"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="do.archive+profile.available"> + <and> + <isset property="profile.available"/> + <istrue value="${do.archive}"/> + </and> + </condition> + <condition property="have.tests"> + <or> + <available file="${test.src.dir}"/> + </or> + </condition> + <condition property="have.sources"> + <or> + <available file="${src.dir}"/> + </or> + </condition> + <condition property="netbeans.home+have.tests"> + <and> + <isset property="netbeans.home"/> + <isset property="have.tests"/> + </and> + </condition> + <condition property="no.javadoc.preview"> + <and> + <isset property="javadoc.preview"/> + <isfalse value="${javadoc.preview}"/> + </and> + </condition> + <property name="run.jvmargs" value=""/> + <property name="run.jvmargs.ide" value=""/> + <property name="javac.compilerargs" value=""/> + <property name="work.dir" value="${basedir}"/> + <condition property="no.deps"> + <and> + <istrue value="${no.dependencies}"/> + </and> + </condition> + <property name="javac.debug" value="true"/> + <property name="javadoc.preview" value="true"/> + <property name="application.args" value=""/> + <property name="source.encoding" value="${file.encoding}"/> + <property name="runtime.encoding" value="${source.encoding}"/> + <property name="manifest.encoding" value="${source.encoding}"/> + <condition property="javadoc.encoding.used" value="${javadoc.encoding}"> + <and> + <isset property="javadoc.encoding"/> + <not> + <equals arg1="${javadoc.encoding}" arg2=""/> + </not> + </and> + </condition> + <property name="javadoc.encoding.used" value="${source.encoding}"/> + <property name="includes" value="**"/> + <property name="excludes" value=""/> + <property name="do.depend" value="false"/> + <condition property="do.depend.true"> + <istrue value="${do.depend}"/> + </condition> + <path id="endorsed.classpath.path" path="${endorsed.classpath}"/> + <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'"> + <and> + <isset property="endorsed.classpath"/> + <not> + <equals arg1="${endorsed.classpath}" arg2="" trim="true"/> + </not> + </and> + </condition> + <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}"> + <isset property="profile.available"/> + </condition> + <condition else="false" property="jdkBug6558476"> + <and> + <matches pattern="1\.[56]" string="${java.specification.version}"/> + <not> + <os family="unix"/> + </not> + </and> + </condition> + <condition else="false" property="javac.fork"> + <or> + <istrue value="${jdkBug6558476}"/> + <istrue value="${javac.external.vm}"/> + </or> + </condition> + <property name="jar.index" value="false"/> + <property name="jar.index.metainf" value="${jar.index}"/> + <property name="copylibs.rebase" value="true"/> + <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/> + <condition property="junit.available"> + <or> + <available classname="org.junit.Test" classpath="${run.test.classpath}"/> + <available classname="junit.framework.Test" classpath="${run.test.classpath}"/> + </or> + </condition> + <condition property="testng.available"> + <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/> + </condition> + <condition property="junit+testng.available"> + <and> + <istrue value="${junit.available}"/> + <istrue value="${testng.available}"/> + </and> + </condition> + <condition else="testng" property="testng.mode" value="mixed"> + <istrue value="${junit+testng.available}"/> + </condition> + <condition else="" property="testng.debug.mode" value="-mixed"> + <istrue value="${junit+testng.available}"/> + </condition> + <property name="java.failonerror" value="true"/> + </target> + <target name="-post-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check"> + <fail unless="src.dir">Must set src.dir</fail> + <fail unless="test.src.dir">Must set test.src.dir</fail> + <fail unless="build.dir">Must set build.dir</fail> + <fail unless="dist.dir">Must set dist.dir</fail> + <fail unless="build.classes.dir">Must set build.classes.dir</fail> + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail> + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail> + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail> + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail> + <fail unless="dist.jar">Must set dist.jar</fail> + </target> + <target name="-init-macrodef-property"> + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute name="name"/> + <attribute name="value"/> + <sequential> + <property name="@{name}" value="${@{value}}"/> + </sequential> + </macrodef> + </target> + <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="modules.supported.internal" name="-init-macrodef-javac-with-module"> + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <attribute default="${javac.modulepath}" name="modulepath"/> + <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/> + <attribute default="${javac.processorpath}" name="processorpath"/> + <attribute default="${javac.processormodulepath}" name="processormodulepath"/> + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="${javac.debug}" name="debug"/> + <attribute default="${empty.dir}" name="sourcepath" unless:set="named.module.internal"/> + <attribute default="${src.dir}" if:set="named.module.internal" name="sourcepath"/> + <attribute default="${empty.dir}" name="gensrcdir"/> + <element name="customize" optional="true"/> + <sequential> + <condition property="warn.excludes.internal"> + <and> + <isset property="named.module.internal"/> + <length length="0" string="@{excludes}" trim="true" when="greater"/> + </and> + </condition> + <echo if:set="warn.excludes.internal" level="warning" message="The javac excludes are not supported in the JDK 9 Named Module."/> + <property location="${build.dir}/empty" name="empty.dir"/> + <mkdir dir="${empty.dir}"/> + <mkdir dir="@{apgeneratedsrcdir}"/> + <condition property="processormodulepath.set"> + <resourcecount count="0" when="greater"> + <path> + <pathelement path="@{processormodulepath}"/> + </path> + </resourcecount> + </condition> + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> + <src> + <dirset dir="@{gensrcdir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </src> + <classpath> + <path path="@{classpath}"/> + </classpath> + <modulepath> + <path path="@{modulepath}"/> + </modulepath> + <upgrademodulepath> + <path path="@{upgrademodulepath}"/> + </upgrademodulepath> + <compilerarg line="${javac.systemmodulepath.cmd.line.arg}"/> + <compilerarg line="${javac.profile.cmd.line.arg}"/> + <compilerarg line="${javac.compilerargs}"/> + <compilerarg if:set="processormodulepath.set" value="--processor-module-path"/> + <compilerarg if:set="processormodulepath.set" path="@{processormodulepath}"/> + <compilerarg unless:set="processormodulepath.set" value="-processorpath"/> + <compilerarg path="@{processorpath}:${empty.dir}" unless:set="processormodulepath.set"/> + <compilerarg line="${ap.processors.internal}"/> + <compilerarg line="${annotation.processing.processor.options}"/> + <compilerarg value="-s"/> + <compilerarg path="@{apgeneratedsrcdir}"/> + <compilerarg line="${ap.proc.none.internal}"/> + <customize/> + </javac> + </sequential> + </macrodef> + </target> + <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors" unless="modules.supported.internal"> + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <attribute default="${javac.modulepath}" name="modulepath"/> + <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/> + <attribute default="${javac.processorpath}" name="processorpath"/> + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="${javac.debug}" name="debug"/> + <attribute default="${empty.dir}" name="sourcepath"/> + <attribute default="${empty.dir}" name="gensrcdir"/> + <element name="customize" optional="true"/> + <sequential> + <property location="${build.dir}/empty" name="empty.dir"/> + <mkdir dir="${empty.dir}"/> + <mkdir dir="@{apgeneratedsrcdir}"/> + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> + <src> + <dirset dir="@{gensrcdir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </src> + <classpath> + <path path="@{classpath}"/> + </classpath> + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/> + <compilerarg line="${javac.profile.cmd.line.arg}"/> + <compilerarg line="${javac.compilerargs}"/> + <compilerarg value="-processorpath"/> + <compilerarg path="@{processorpath}:${empty.dir}"/> + <compilerarg line="${ap.processors.internal}"/> + <compilerarg line="${annotation.processing.processor.options}"/> + <compilerarg value="-s"/> + <compilerarg path="@{apgeneratedsrcdir}"/> + <compilerarg line="${ap.proc.none.internal}"/> + <customize/> + </javac> + </sequential> + </macrodef> + </target> + <target depends="-init-ap-cmdline-properties,-init-source-module-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal"> + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <attribute default="${javac.modulepath}" name="modulepath"/> + <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/> + <attribute default="${javac.processorpath}" name="processorpath"/> + <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="${javac.debug}" name="debug"/> + <attribute default="${empty.dir}" name="sourcepath"/> + <attribute default="${empty.dir}" name="gensrcdir"/> + <element name="customize" optional="true"/> + <sequential> + <property location="${build.dir}/empty" name="empty.dir"/> + <mkdir dir="${empty.dir}"/> + <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"> + <src> + <dirset dir="@{gensrcdir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </src> + <classpath> + <path path="@{classpath}"/> + </classpath> + <compilerarg line="${endorsed.classpath.cmd.line.arg}"/> + <compilerarg line="${javac.profile.cmd.line.arg}"/> + <compilerarg line="${javac.compilerargs}"/> + <customize/> + </javac> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-javac-with-module,-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac"> + <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${src.dir}" name="srcdir"/> + <attribute default="${build.classes.dir}" name="destdir"/> + <attribute default="${javac.classpath}" name="classpath"/> + <sequential> + <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}"> + <classpath> + <path path="@{classpath}"/> + </classpath> + </depend> + </sequential> + </macrodef> + <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${build.classes.dir}" name="destdir"/> + <sequential> + <fail unless="javac.includes">Must set javac.includes</fail> + <pathconvert pathsep="${line.separator}" property="javac.includes.binary"> + <path> + <filelist dir="@{destdir}" files="${javac.includes}"/> + </path> + <globmapper from="*.java" to="*.class"/> + </pathconvert> + <tempfile deleteonexit="true" property="javac.includesfile.binary"/> + <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/> + <delete> + <files includesfile="${javac.includesfile.binary}"/> + </delete> + <delete> + <fileset file="${javac.includesfile.binary}"/> + </delete> + </sequential> + </macrodef> + </target> + <target if="${junit.available}" name="-init-macrodef-junit-init"> + <condition else="false" property="nb.junit.batch" value="true"> + <and> + <istrue value="${junit.available}"/> + <not> + <isset property="test.method"/> + </not> + </and> + </condition> + <condition else="false" property="nb.junit.single" value="true"> + <and> + <istrue value="${junit.available}"/> + <isset property="test.method"/> + </and> + </condition> + </target> + <target name="-init-test-properties"> + <property name="test.binaryincludes" value="<nothing>"/> + <property name="test.binarytestincludes" value=""/> + <property name="test.binaryexcludes" value=""/> + </target> + <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-junit-prototype-with-module"> + <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <element name="customizePrototype" optional="true"/> + <sequential> + <property name="junit.forkmode" value="perTest"/> + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}"> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + <modulepath> + <path path="${run.test.modulepath}"/> + </modulepath> + <formatter type="brief" usefile="false"/> + <formatter type="xml"/> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg value="-ea"/> + <jvmarg line="${run.test.jvmargs}"/> + <customizePrototype/> + </junit> + </sequential> + </macrodef> + </target> + <target depends="-init-modules-supported" name="-init-macrodef-junit-prototype-without-module" unless="modules.supported.internal"> + <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <element name="customizePrototype" optional="true"/> + <sequential> + <property name="junit.forkmode" value="perTest"/> + <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}"> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + <formatter type="brief" usefile="false"/> + <formatter type="xml"/> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg value="-ea"/> + <customizePrototype/> + </junit> + </sequential> + </macrodef> + </target> + <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}"> + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <attribute default="" name="testmethods"/> + <element name="customize" optional="true"/> + <sequential> + <j2seproject3:junit-prototype> + <customizePrototype> + <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/> + <customize/> + </customizePrototype> + </j2seproject3:junit-prototype> + </sequential> + </macrodef> + </target> + <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}"> + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <attribute default="" name="testmethods"/> + <element name="customize" optional="true"/> + <sequential> + <j2seproject3:junit-prototype> + <customizePrototype> + <batchtest todir="${build.test.results.dir}"> + <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> + <filename name="@{testincludes}"/> + </fileset> + <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}"> + <filename name="${test.binarytestincludes}"/> + </fileset> + </batchtest> + <customize/> + </customizePrototype> + </j2seproject3:junit-prototype> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/> + <target if="${testng.available}" name="-init-macrodef-testng"> + <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <attribute default="" name="testmethods"/> + <element name="customize" optional="true"/> + <sequential> + <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}"> + <isset property="test.method"/> + </condition> + <union id="test.set"> + <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}"> + <filename name="@{testincludes}"/> + </fileset> + </union> + <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/> + <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="AplikasiKasir" testname="TestNG tests" workingDir="${work.dir}"> + <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/> + <propertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </propertyset> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <customize/> + </testng> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-test-impl"> + <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <attribute default="" name="testmethods"/> + <element implicit="true" name="customize" optional="true"/> + <sequential> + <echo>No tests executed.</echo> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl"> + <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <attribute default="" name="testmethods"/> + <element implicit="true" name="customize" optional="true"/> + <sequential> + <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> + <customize/> + </j2seproject3:junit> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl"> + <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <attribute default="" name="testmethods"/> + <element implicit="true" name="customize" optional="true"/> + <sequential> + <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> + <customize/> + </j2seproject3:testng> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test"> + <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <attribute default="" name="testmethods"/> + <sequential> + <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> + <customize> + <jvmarg line="${run.jvmargs}"/> + <jvmarg line="${run.jvmargs.ide}"/> + </customize> + </j2seproject3:test-impl> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-debug-impl"> + <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <attribute default="" name="testmethods"/> + <element name="customizeDebuggee" optional="true"/> + <sequential> + <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> + <customize> + <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/> + <customizeDebuggee/> + </customize> + </j2seproject3:junit> + </sequential> + </macrodef> + </target> + <target if="${testng.available}" name="-init-macrodef-testng-debug"> + <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${main.class}" name="testClass"/> + <attribute default="" name="testMethod"/> + <element name="customize2" optional="true"/> + <sequential> + <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}"> + <isset property="test.method"/> + </condition> + <condition else="-suitename AplikasiKasir -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}"> + <matches pattern=".*\.xml" string="@{testClass}"/> + </condition> + <delete dir="${build.test.results.dir}" quiet="true"/> + <mkdir dir="${build.test.results.dir}"/> + <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}"> + <customizeDebuggee> + <customize2/> + <jvmarg value="-ea"/> + <arg line="${testng.debug.mode}"/> + <arg line="-d ${build.test.results.dir}"/> + <arg line="-listener org.testng.reporters.VerboseReporter"/> + <arg line="${testng.cmd.args}"/> + </customizeDebuggee> + </j2seproject3:debug> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl"> + <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${main.class}" name="testClass"/> + <attribute default="" name="testMethod"/> + <element implicit="true" name="customize2" optional="true"/> + <sequential> + <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}"> + <customize2/> + </j2seproject3:testng-debug> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit"> + <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <attribute default="" name="testmethods"/> + <attribute default="${main.class}" name="testClass"/> + <attribute default="" name="testMethod"/> + <sequential> + <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}"> + <customizeDebuggee> + <jvmarg line="${run.jvmargs}"/> + <jvmarg line="${run.jvmargs.ide}"/> + </customizeDebuggee> + </j2seproject3:test-debug-impl> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng"> + <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${includes}" name="includes"/> + <attribute default="${excludes}" name="excludes"/> + <attribute default="**" name="testincludes"/> + <attribute default="" name="testmethods"/> + <attribute default="${main.class}" name="testClass"/> + <attribute default="" name="testMethod"/> + <sequential> + <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}"> + <customize2> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper from="test-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + </customize2> + </j2seproject3:testng-debug-impl> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/> + <!-- + pre NB7.2 profiling section; consider it deprecated + --> + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/> + <target if="profiler.info.jvmargs.agent" name="-profile-pre-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target if="profiler.info.jvmargs.agent" name="-profile-post-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile"> + <macrodef name="resolve"> + <attribute name="name"/> + <attribute name="value"/> + <sequential> + <property name="@{name}" value="${env.@{value}}"/> + </sequential> + </macrodef> + <macrodef name="profile"> + <attribute default="${main.class}" name="classname"/> + <element name="customize" optional="true"/> + <sequential> + <property environment="env"/> + <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/> + <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}"> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg value="${profiler.info.jvmargs.agent}"/> + <jvmarg line="${profiler.info.jvmargs}"/> + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> + <arg line="${application.args}"/> + <classpath> + <path path="${run.classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check"> + <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail> + <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail> + </target> + <!-- + end of pre NB7.2 profiling section + --> + <target depends="-init-debug-args" name="-init-macrodef-nbjpda"> + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${main.class}" name="name"/> + <attribute default="${debug.modulepath}" name="modulepath"/> + <attribute default="${debug.classpath}" name="classpath"/> + <attribute default="" name="stopclassname"/> + <sequential> + <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}"> + <modulepath> + <path path="@{modulepath}"/> + </modulepath> + <classpath> + <path path="@{classpath}"/> + </classpath> + </nbjpdastart> + </sequential> + </macrodef> + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${build.classes.dir}" name="dir"/> + <sequential> + <nbjpdareload> + <fileset dir="@{dir}" includes="${fix.classes}"> + <include name="${fix.includes}*.class"/> + </fileset> + </nbjpdareload> + </sequential> + </macrodef> + </target> + <target name="-init-debug-args"> + <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem"> + <os family="windows"/> + </condition> + <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}"> + <isset property="debug.transport"/> + </condition> + </target> + <target depends="-init-debug-args" name="-init-macrodef-debug"> + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${module.name}" name="modulename"/> + <attribute default="${main.class}" name="classname"/> + <attribute default="${debug.modulepath}" name="modulepath"/> + <attribute default="${debug.classpath}" name="classpath"/> + <element name="customizeDebuggee" optional="true"/> + <sequential> + <j2seproject1:java classname="@{classname}" classpath="@{classpath}" modulename="@{modulename}" modulepath="@{modulepath}"> + <customize> + <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/> + <customizeDebuggee/> + </customize> + </j2seproject1:java> + </sequential> + </macrodef> + </target> + <target depends="-init-source-module-properties" if="named.module.internal" name="-init-macrodef-java-with-module"> + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="${module.name}" name="modulename"/> + <attribute default="${main.class}" name="classname"/> + <attribute default="${run.modulepath}" name="modulepath"/> + <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/> + <attribute default="${run.classpath}" name="classpath"/> + <attribute default="jvm" name="jvm"/> + <element name="customize" optional="true"/> + <sequential> + <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" module="@{modulename}"> + <classpath> + <path path="@{classpath}"/> + </classpath> + <modulepath> + <pathelement path="@{modulepath}"/> + <pathelement location="${module.build.classes.dir}"/> + </modulepath> + <upgrademodulepath> + <path path="@{upgrademodulepath}"/> + </upgrademodulepath> + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> + <jvmarg line="${run.jvmargs}"/> + <jvmarg line="${run.jvmargs.ide}"/> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target depends="-init-source-module-properties" if="unnamed.module.internal" name="-init-macrodef-java-with-unnamed-module"> + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="" name="modulename"/> + <attribute default="${main.class}" name="classname"/> + <attribute default="${run.modulepath}" name="modulepath"/> + <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/> + <attribute default="${run.classpath}" name="classpath"/> + <attribute default="jvm" name="jvm"/> + <element name="customize" optional="true"/> + <sequential> + <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true"> + <classpath> + <path path="@{classpath}"/> + </classpath> + <modulepath> + <path path="@{modulepath}"/> + </modulepath> + <upgrademodulepath> + <path path="@{upgrademodulepath}"/> + </upgrademodulepath> + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> + <jvmarg line="${run.jvmargs}"/> + <jvmarg line="${run.jvmargs.ide}"/> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target depends="-init-source-module-properties" name="-init-macrodef-java-without-module" unless="modules.supported.internal"> + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute default="" name="modulename"/> + <attribute default="${main.class}" name="classname"/> + <attribute default="" name="modulepath"/> + <attribute default="${run.classpath}" name="classpath"/> + <attribute default="jvm" name="jvm"/> + <element name="customize" optional="true"/> + <sequential> + <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true"> + <jvmarg line="${endorsed.classpath.cmd.line.arg}"/> + <jvmarg value="-Dfile.encoding=${runtime.encoding}"/> + <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/> + <jvmarg line="${run.jvmargs}"/> + <jvmarg line="${run.jvmargs.ide}"/> + <classpath> + <path path="@{classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper from="run-sys-prop.*" to="*" type="glob"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target depends="-init-macrodef-java-with-module, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-module" name="-init-macrodef-java"/> + <target name="-init-macrodef-copylibs"> + <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute default="${manifest.file}" name="manifest"/> + <element name="customize" optional="true"/> + <sequential> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <pathconvert property="run.classpath.without.build.classes.dir"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to=""/> + </pathconvert> + <pathconvert pathsep=" " property="jar.classpath"> + <path path="${run.classpath.without.build.classes.dir}"/> + <chainedmapper> + <flattenmapper/> + <filtermapper> + <replacestring from=" " to="%20"/> + </filtermapper> + <globmapper from="*" to="lib/*"/> + </chainedmapper> + </pathconvert> + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/> + <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" manifestencoding="UTF-8" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> + <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/> + <manifest> + <attribute name="Class-Path" value="${jar.classpath}"/> + <customize/> + </manifest> + </copylibs> + </sequential> + </macrodef> + </target> + <target name="-init-presetdef-jar"> + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1"> + <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8"> + <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/> + </jar> + </presetdef> + </target> + <target name="-init-ap-cmdline-properties"> + <property name="annotation.processing.enabled" value="true"/> + <property name="annotation.processing.processors.list" value=""/> + <property name="annotation.processing.processor.options" value=""/> + <property name="annotation.processing.run.all.processors" value="true"/> + <property name="javac.processorpath" value="${javac.classpath}"/> + <property name="javac.test.processorpath" value="${javac.test.classpath}"/> + <condition property="ap.supported.internal" value="true"> + <not> + <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/> + </not> + </condition> + </target> + <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported"> + <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}"> + <isfalse value="${annotation.processing.run.all.processors}"/> + </condition> + <condition else="" property="ap.proc.none.internal" value="-proc:none"> + <isfalse value="${annotation.processing.enabled}"/> + </condition> + </target> + <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline"> + <property name="ap.cmd.line.internal" value=""/> + </target> + <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/> + <!-- + =================== + COMPILATION SECTION + =================== + --> + <target name="-deps-jar-init" unless="built-jar.properties"> + <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/> + <delete file="${built-jar.properties}" quiet="true"/> + </target> + <target if="already.built.jar.${basedir}" name="-warn-already-built-jar"> + <echo level="warn" message="Cycle detected: AplikasiKasir was already built"/> + </target> + <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps"> + <mkdir dir="${build.dir}"/> + <touch file="${built-jar.properties}" verbose="false"/> + <property file="${built-jar.properties}" prefix="already.built.jar."/> + <antcall target="-warn-already-built-jar"/> + <propertyfile file="${built-jar.properties}"> + <entry key="${basedir}" value=""/> + </propertyfile> + </target> + <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/> + <target depends="init" name="-check-automatic-build"> + <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/> + </target> + <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build"> + <antcall target="clean"> + <param name="no.dependencies" value="true"/> + </antcall> + </target> + <target depends="init,deps-jar" name="-pre-pre-compile"> + <mkdir dir="${build.classes.dir}"/> + </target> + <target name="-pre-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target if="do.depend.true" name="-compile-depend"> + <pathconvert property="build.generated.subdirs"> + <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="*"/> + </dirset> + </pathconvert> + <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/> + </target> + <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile"> + <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/> + <copy todir="${build.classes.dir}"> + <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target if="has.persistence.xml" name="-copy-persistence-xml"> + <mkdir dir="${build.classes.dir}/META-INF"/> + <copy todir="${build.classes.dir}/META-INF"> + <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/> + </copy> + </target> + <target name="-post-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/> + <target name="-pre-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:force-recompile/> + <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java" sourcepath="${src.dir}"/> + </target> + <target name="-post-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/> + <!-- + ==================== + JAR BUILDING SECTION + ==================== + --> + <target depends="init" name="-pre-pre-jar"> + <dirname file="${dist.jar}" property="dist.jar.dir"/> + <mkdir dir="${dist.jar.dir}"/> + </target> + <target name="-pre-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile" name="-check-module-main-class"> + <pathconvert property="main.class.file"> + <string value="${main.class}"/> + <unpackagemapper from="*" to="*.class"/> + </pathconvert> + <condition property="do.module.main.class"> + <and> + <isset property="main.class.available"/> + <available file="${build.classes.dir}/module-info.class"/> + <available file="${build.classes.dir}/${main.class.file}"/> + <isset property="libs.CopyLibs.classpath"/> + <available classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}"/> + </and> + </condition> + </target> + <target depends="-check-module-main-class" if="do.module.main.class" name="-set-module-main-class"> + <taskdef classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}" name="modulemainclass"/> + <modulemainclass failonerror="false" mainclass="${main.class}" moduleinfo="${build.classes.dir}/module-info.class"/> + </target> + <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available"> + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/> + <touch file="${tmp.manifest.file}" verbose="false"/> + </target> + <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest"> + <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/> + <copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/> + </target> + <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass"> + <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update"> + <attribute name="Main-Class" value="${main.class}"/> + </manifest> + </target> + <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile"> + <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update"> + <attribute name="Profile" value="${javac.profile}"/> + </manifest> + </target> + <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen"> + <basename file="${application.splash}" property="splashscreen.basename"/> + <mkdir dir="${build.classes.dir}/META-INF"/> + <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/> + <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update"> + <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/> + </manifest> + </target> + <target depends="init,compile" name="-check-do-mkdist"> + <condition property="do.mkdist"> + <and> + <isset property="do.archive"/> + <isset property="libs.CopyLibs.classpath"/> + <not> + <istrue value="${mkdist.disabled}"/> + </not> + <not> + <available file="${build.classes.dir}/module-info.class"/> + </not> + </and> + </condition> + </target> + <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.mkdist" name="-do-jar-copylibs"> + <j2seproject3:copylibs manifest="${tmp.manifest.file}"/> + <echo level="info">To run this application from the command line without Ant, try:</echo> + <property location="${dist.jar}" name="dist.jar.resolved"/> + <echo level="info">java -jar "${dist.jar.resolved}"</echo> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.archive" name="-do-jar-jar" unless="do.mkdist"> + <j2seproject1:jar manifest="${tmp.manifest.file}"/> + <property location="${build.classes.dir}" name="build.classes.dir.resolved"/> + <property location="${dist.jar}" name="dist.jar.resolved"/> + <condition else="${dist.jar.resolved}" property="jar.usage.message.class.path.replacement" value=""> + <isset property="named.module.internal"/> + </condition> + <pathconvert property="run.classpath.with.dist.jar"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to="${jar.usage.message.class.path.replacement}"/> + </pathconvert> + <pathconvert property="run.modulepath.with.dist.jar"> + <path location="${dist.jar.resolved}"/> + <path path="${run.modulepath}"/> + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/> + </pathconvert> + <condition else="${run.modulepath}" property="jar.usage.message.run.modulepath.with.dist.jar" value="${run.modulepath.with.dist.jar}"> + <isset property="named.module.internal"/> + </condition> + <condition else="" property="jar.usage.message.module.path" value=" -p ${jar.usage.message.run.modulepath.with.dist.jar}"> + <and> + <isset property="modules.supported.internal"/> + <length length="0" string="${jar.usage.message.run.modulepath.with.dist.jar}" when="greater"/> + </and> + </condition> + <condition else="" property="jar.usage.message.class.path" value=" -cp ${run.classpath.with.dist.jar}"> + <length length="0" string="${run.classpath.with.dist.jar}" when="greater"/> + </condition> + <condition else="/${main.class}" property="jar.usage.message.main.class.class.selector" value=""> + <isset property="do.module.main.class"/> + </condition> + <condition else=" ${main.class}" property="jar.usage.message.main.class" value=" -m ${module.name}${jar.usage.message.main.class.class.selector}"> + <isset property="named.module.internal"/> + </condition> + <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java}${jar.usage.message.module.path}${jar.usage.message.class.path}${jar.usage.message.main.class}"> + <isset property="main.class.available"/> + </condition> + <condition else="debug" property="jar.usage.level" value="info"> + <isset property="main.class.available"/> + </condition> + <echo level="${jar.usage.level}" message="${jar.usage.message}"/> + </target> + <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest"> + <delete> + <fileset file="${tmp.manifest.file}"/> + </delete> + </target> + <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/> + <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/> + <target name="-post-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-jar,-set-module-main-class,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/> + <target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/> + <!-- + ================= + DEPLOY SECTION + ================= + --> + <target name="-pre-deploy"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init" name="-check-jlink"> + <condition property="do.jlink.internal"> + <and> + <istrue value="${do.jlink}"/> + <isset property="do.archive"/> + <isset property="named.module.internal"/> + </and> + </condition> + </target> + <target depends="init,-do-jar,-post-jar,-pre-deploy,-check-jlink" if="do.jlink.internal" name="-do-deploy"> + <delete dir="${dist.jlink.dir}" failonerror="false" quiet="true"/> + <property name="jlink.launcher.name" value="${application.title}"/> + <condition else="${module.name}" property="jlink.add.modules" value="${module.name},${jlink.additionalmodules}"> + <and> + <isset property="jlink.additionalmodules"/> + <length length="0" string="${jlink.additionalmodules}" when="greater"/> + </and> + </condition> + <condition property="jlink.do.strip.internal"> + <and> + <isset property="jlink.strip"/> + <istrue value="${jlink.strip}"/> + </and> + </condition> + <condition property="jlink.do.additionalparam.internal"> + <and> + <isset property="jlink.additionalparam"/> + <length length="0" string="${jlink.additionalparam}" when="greater"/> + </and> + </condition> + <condition property="jlink.do.launcher.internal"> + <and> + <istrue value="${jlink.launcher}"/> + <isset property="main.class.available"/> + </and> + </condition> + <property name="platform.jlink" value="${jdk.home}/bin/jlink"/> + <property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/> + <exec executable="${platform.jlink}"> + <arg value="--module-path"/> + <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/> + <arg value="--add-modules"/> + <arg value="${jlink.add.modules}"/> + <arg if:set="jlink.do.strip.internal" value="--strip-debug"/> + <arg if:set="jlink.do.launcher.internal" value="--launcher"/> + <arg if:set="jlink.do.launcher.internal" value="${jlink.launcher.name}=${module.name}/${main.class}"/> + <arg if:set="jlink.do.additionalparam.internal" line="${jlink.additionalparam}"/> + <arg value="--output"/> + <arg value="${dist.jlink.output}"/> + </exec> + </target> + <target name="-post-deploy"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/> + <!-- + ================= + EXECUTION SECTION + ================= + --> + <target depends="init,compile" description="Run a main class." name="run"> + <j2seproject1:java> + <customize> + <arg line="${application.args}"/> + </customize> + </j2seproject1:java> + </target> + <target name="-do-not-recompile"> + <property name="javac.includes.binary" value=""/> + </target> + <target depends="init,compile-single" name="run-single"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <j2seproject1:java classname="${run.class}"/> + </target> + <target depends="init,compile-test-single" name="run-test-with-main"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/> + </target> + <!-- + ================= + DEBUGGING SECTION + ================= + --> + <target depends="init" if="netbeans.home" name="-debug-start-debugger"> + <j2seproject1:nbjpdastart name="${debug.class}"/> + </target> + <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test"> + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/> + </target> + <target depends="init,compile" name="-debug-start-debuggee"> + <j2seproject3:debug> + <customizeDebuggee> + <arg line="${application.args}"/> + </customizeDebuggee> + </j2seproject3:debug> + </target> + <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/> + <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto"> + <j2seproject1:nbjpdastart stopclassname="${main.class}"/> + </target> + <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/> + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single"> + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> + <j2seproject3:debug classname="${debug.class}"/> + </target> + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/> + <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test"> + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> + <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/> + </target> + <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/> + <target depends="init" name="-pre-debug-fix"> + <fail unless="fix.includes">Must set fix.includes</fail> + <property name="javac.includes" value="${fix.includes}.java"/> + </target> + <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix"> + <j2seproject1:nbjpdareload/> + </target> + <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/> + <!-- + ================= + PROFILING SECTION + ================= + --> + <!-- + pre NB7.2 profiler integration + --> + <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72"> + <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail> + <nbprofiledirect> + <classpath> + <path path="${run.classpath}"/> + </classpath> + </nbprofiledirect> + <profile/> + </target> + <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72"> + <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail> + <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail> + <nbprofiledirect> + <classpath> + <path path="${run.classpath}"/> + </classpath> + </nbprofiledirect> + <profile classname="${profile.class}"/> + </target> + <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72"> + <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail> + <nbprofiledirect> + <classpath> + <path path="${run.classpath}"/> + </classpath> + </nbprofiledirect> + <profile classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </profile> + </target> + <target depends="-init-macrodef-junit,profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72"> + <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail> + <nbprofiledirect> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + </nbprofiledirect> + <j2seproject3:junit excludes="${excludes}" includes="${includes}" testincludes="${profile.class}" testmethods=""> + <customize> + <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/> + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> + <jvmarg value="${profiler.info.jvmargs.agent}"/> + <jvmarg line="${profiler.info.jvmargs}"/> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + </customize> + </j2seproject3:junit> + </target> + <!-- + end of pre NB72 profiling section + --> + <target if="netbeans.home" name="-profile-check"> + <condition property="profiler.configured"> + <or> + <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/> + <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/> + </or> + </condition> + </target> + <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent"> + <startprofiler/> + <antcall target="run"/> + </target> + <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <startprofiler/> + <antcall target="run-single"/> + </target> + <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/> + <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs"> + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail> + <startprofiler/> + <antcall target="test-single"/> + </target> + <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <startprofiler/> + <antcall target="run-test-with-main"/> + </target> + <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <startprofiler/> + <antcall target="run-applet"/> + </target> + <!-- + =============== + JAVADOC SECTION + =============== + --> + <target depends="init" if="have.sources" name="-javadoc-build"> + <mkdir dir="${dist.javadoc.dir}"/> + <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}"> + <and> + <isset property="endorsed.classpath.cmd.line.arg"/> + <not> + <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/> + </not> + </and> + </condition> + <condition else="" property="bug5101868workaround" value="*.java"> + <matches pattern="1\.[56](\..*)?" string="${java.version}"/> + </condition> + <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5"> + <and> + <isset property="javadoc.html5"/> + <available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/> + </and> + </condition> + <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}"> + <classpath> + <path path="${javac.classpath}"/> + </classpath> + <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}"> + <filename name="**/*.java"/> + </fileset> + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="**/*.java"/> + <exclude name="*.java"/> + </fileset> + <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/> + <arg line="${javadoc.html5.cmd.line.arg}"/> + </javadoc> + <copy todir="${dist.javadoc.dir}"> + <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}"> + <filename name="**/doc-files/**"/> + </fileset> + <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false"> + <include name="**/doc-files/**"/> + </fileset> + </copy> + </target> + <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview"> + <nbbrowse file="${dist.javadoc.dir}/index.html"/> + </target> + <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/> + <!-- + ========================= + TEST COMPILATION SECTION + ========================= + --> + <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test"> + <mkdir dir="${build.test.classes.dir}"/> + </target> + <target name="-pre-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-javac-module-properties-with-module"> + <j2seproject3:modulename property="test.module.name" sourcepath="${test.src.dir}"/> + <condition else="${empty.dir}" property="javac.test.sourcepath" value="${test.src.dir}"> + <and> + <isset property="test.module.name"/> + <length length="0" string="${test.module.name}" when="greater"/> + </and> + </condition> + <condition else="--patch-module ${module.name}=${test.src.dir} --add-reads ${module.name}=ALL-UNNAMED" property="javac.test.compilerargs" value="--add-reads ${test.module.name}=ALL-UNNAMED"> + <and> + <isset property="test.module.name"/> + <length length="0" string="${test.module.name}" when="greater"/> + </and> + </condition> + </target> + <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-run-module-properties"> + <condition else="${module.name}" property="run.test.addexport.source.module.internal" value="${test.module.name}"> + <and> + <isset property="test.module.name"/> + <length length="0" string="${test.module.name}" when="greater"/> + </and> + </condition> + <fileset dir="${build.test.classes.dir}" id="run.test.packages.internal" includes="**/*.class"/> + <property location="${build.test.classes.dir}" name="build.test.classes.dir.abs.internal"/> + <pathconvert pathsep=" " property="run.test.addexports.internal" refid="run.test.packages.internal"> + <chainedmapper> + <regexpmapper from="^(.*)\Q${file.separator}\E.*\.class$$" to="\1"/> + <filtermapper> + <uniqfilter/> + <replacestring from="${build.test.classes.dir.abs.internal}" to=""/> + </filtermapper> + <cutdirsmapper dirs="1"/> + <packagemapper from="*" to="--add-exports ${run.test.addexport.source.module.internal}/*=ALL-UNNAMED"/> + </chainedmapper> + </pathconvert> + <condition else="--patch-module ${module.name}=${build.test.classes.dir} --add-modules ${module.name} --add-reads ${module.name}=ALL-UNNAMED ${run.test.addexports.internal}" property="run.test.jvmargs" value="--add-modules ${test.module.name} --add-reads ${test.module.name}=ALL-UNNAMED ${run.test.addexports.internal}"> + <and> + <isset property="test.module.name"/> + <length length="0" string="${test.module.name}" when="greater"/> + </and> + </condition> + </target> + <target depends="-init-source-module-properties" name="-init-test-module-properties-without-module" unless="named.module.internal"> + <property name="javac.test.sourcepath" value="${empty.dir}"/> + <property name="javac.test.compilerargs" value=""/> + <property name="run.test.jvmargs" value=""/> + </target> + <target depends="-init-test-javac-module-properties-with-module,-init-test-module-properties-without-module" name="-init-test-module-properties"/> + <target if="do.depend.true" name="-compile-test-depend"> + <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/> + </target> + <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test"> + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${javac.test.sourcepath}" srcdir="${test.src.dir}"> + <customize> + <compilerarg line="${javac.test.compilerargs}"/> + </customize> + </j2seproject3:javac> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/> + <target name="-pre-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/> + <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}, module-info.java" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"> + <customize> + <compilerarg line="${javac.test.compilerargs}"/> + </customize> + </j2seproject3:javac> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> + </copy> + </target> + <target name="-post-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/> + <!-- + ======================= + TEST EXECUTION SECTION + ======================= + --> + <target depends="init" if="have.tests" name="-pre-test-run"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target depends="init,compile-test,-init-test-run-module-properties,-pre-test-run" if="have.tests" name="-do-test-run"> + <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/> + </target> + <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run"> + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> + </target> + <target depends="init" if="have.tests" name="test-report"/> + <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/> + <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/> + <target depends="init" if="have.tests" name="-pre-test-run-single"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-do-test-run-single"> + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail> + <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/> + </target> + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single"> + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> + </target> + <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/> + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method"> + <fail unless="test.class">Must select some files in the IDE or set test.class</fail> + <fail unless="test.method">Must select some method in the IDE or set test.method</fail> + <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/> + </target> + <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method"> + <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail> + </target> + <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/> + <!-- + ======================= + TEST DEBUGGING SECTION + ======================= + --> + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test"> + <fail unless="test.class">Must select one file in the IDE or set test.class</fail> + <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/> + </target> + <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method"> + <fail unless="test.class">Must select one file in the IDE or set test.class</fail> + <fail unless="test.method">Must select some method in the IDE or set test.method</fail> + <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/> + </target> + <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test"> + <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/> + </target> + <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/> + <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/> + <target depends="debug-test-method" name="debug-single-method"/> + <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test"> + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/> + </target> + <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/> + <!-- + ========================= + APPLET EXECUTION SECTION + ========================= + --> + <target depends="init,compile-single" name="run-applet"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject1:java classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </j2seproject1:java> + </target> + <!-- + ========================= + APPLET DEBUGGING SECTION + ========================= + --> + <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject3:debug classname="sun.applet.AppletViewer"> + <customizeDebuggee> + <arg value="${applet.url}"/> + </customizeDebuggee> + </j2seproject3:debug> + </target> + <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/> + <!-- + =============== + CLEANUP SECTION + =============== + --> + <target name="-deps-clean-init" unless="built-clean.properties"> + <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/> + <delete file="${built-clean.properties}" quiet="true"/> + </target> + <target if="already.built.clean.${basedir}" name="-warn-already-built-clean"> + <echo level="warn" message="Cycle detected: AplikasiKasir was already built"/> + </target> + <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps"> + <mkdir dir="${build.dir}"/> + <touch file="${built-clean.properties}" verbose="false"/> + <property file="${built-clean.properties}" prefix="already.built.clean."/> + <antcall target="-warn-already-built-clean"/> + <propertyfile file="${built-clean.properties}"> + <entry key="${basedir}" value=""/> + </propertyfile> + </target> + <target depends="init" name="-do-clean"> + <delete dir="${build.dir}"/> + <delete dir="${dist.jlink.output}"/> + <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/> + </target> + <target name="-post-clean"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/> + <target name="-check-call-dep"> + <property file="${call.built.properties}" prefix="already.built."/> + <condition property="should.call.dep"> + <and> + <not> + <isset property="already.built.${call.subproject}"/> + </not> + <available file="${call.script}"/> + </and> + </condition> + </target> + <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep"> + <ant antfile="${call.script}" inheritall="false" target="${call.target}"> + <propertyset> + <propertyref prefix="transfer."/> + <mapper from="transfer.*" to="*" type="glob"/> + </propertyset> + </ant> + </target> +</project> diff --git a/Task2/nbproject/genfiles.properties b/Task2/nbproject/genfiles.properties new file mode 100644 index 0000000..280ab50 --- /dev/null +++ b/Task2/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=306947de +build.xml.script.CRC32=0b1e5832 +build.xml.stylesheet.CRC32=f85dc8f2@1.107.0.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=306947de +nbproject/build-impl.xml.script.CRC32=69fa4c21 +nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.107.0.48 diff --git a/Task2/nbproject/private/private.properties b/Task2/nbproject/private/private.properties new file mode 100644 index 0000000..18a4274 --- /dev/null +++ b/Task2/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\vfxki\\AppData\\Roaming\\NetBeans\\18\\build.properties diff --git a/Task2/nbproject/private/private.xml b/Task2/nbproject/private/private.xml new file mode 100644 index 0000000..97a8375 --- /dev/null +++ b/Task2/nbproject/private/private.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> + <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> + <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> + <group> + <file>file:/C:/Users/vfxki/Documents/NetBeansProjects/AplikasiKasir/src/App.java</file> + </group> + </open-files> +</project-private> diff --git a/Task2/nbproject/project.properties b/Task2/nbproject/project.properties new file mode 100644 index 0000000..7ce2c1a --- /dev/null +++ b/Task2/nbproject/project.properties @@ -0,0 +1,97 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processor.options= +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/AplikasiKasir.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/AplikasiKasir +excludes= +file.reference.mysql-connector-j-8.0.32.jar=C:\\Program Files\\Java\\mysql-connector-j-8.0.32\\mysql-connector-j-8.0.32.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.mysql-connector-j-8.0.32.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=17 +javac.target=17 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=AplikasiKasir +main.class=App +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/Task2/nbproject/project.xml b/Task2/nbproject/project.xml new file mode 100644 index 0000000..4ca3dbe --- /dev/null +++ b/Task2/nbproject/project.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.java.j2seproject</type> + <configuration> + <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> + <name>AplikasiKasir</name> + <source-roots> + <root id="src.dir"/> + </source-roots> + <test-roots> + <root id="test.src.dir"/> + </test-roots> + </data> + </configuration> +</project> diff --git a/Task2/src/App.form b/Task2/src/App.form new file mode 100644 index 0000000..f2d844f --- /dev/null +++ b/Task2/src/App.form @@ -0,0 +1,461 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="true"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="33" green="33" red="33" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Component id="jScrollPane1" max="32767" attributes="0"/> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="buttonTambah" min="-2" pref="120" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="buttonHapus" pref="127" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="textNama" pref="150" max="32767" attributes="0"/> + <Component id="textHarga" alignment="0" max="32767" attributes="0"/> + <Component id="textJumlah" alignment="0" max="32767" attributes="0"/> + </Group> + </Group> + <Component id="buttonClear" alignment="0" max="32767" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jPanel3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Component id="jPanel2" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jPanel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="175" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="textNama" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="textHarga" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="textJumlah" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="buttonTambah" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="buttonHapus" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="buttonClear" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jPanel3" max="32767" attributes="0"/> + </Group> + <EmptySpace min="0" pref="3" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel2"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="33" green="33" red="33" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Comic Sans MS" size="18" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="CASH-COMP"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="tabel"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="4" rowCount="4"> + <Column editable="true" title="ID" type="java.lang.Integer"/> + <Column editable="true" title="NAMA" type="java.lang.String"/> + <Column editable="true" title="HARGA" type="java.lang.Long"/> + <Column editable="true" title="JUMLAH" type="java.lang.Integer"/> + </Table> + </Property> + <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> + <TableColumnModel selectionModel="0"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="12" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Nama Barang"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="12" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Harga Barang"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="12" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Jumlah Barang"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textNama"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textHarga"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textJumlah"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="textJumlahActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="buttonTambah"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="ADD"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonTambahActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="buttonHapus"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="DELETE"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonHapusActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="buttonClear"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="0" red="99" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="CLEAR"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonClearActionPerformed"/> + </Events> + </Component> + <Container class="javax.swing.JPanel" name="jPanel3"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="99" green="99" red="99" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="textKembali" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="textTotal" max="32767" attributes="0"/> + <Component id="textTunai" max="32767" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="buttonSimpan" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="buttonBayar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="43" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="textTotal" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="textTunai" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="textKembali" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="34" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="buttonSimpan" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="buttonBayar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Total"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Cash"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Change"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textTotal"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textTunai"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textKembali"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="cc" red="cc" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="buttonSimpan"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="ADD TO CART"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="buttonBayar"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="PAY"/> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/Task2/src/App.java b/Task2/src/App.java new file mode 100644 index 0000000..c37013c --- /dev/null +++ b/Task2/src/App.java @@ -0,0 +1,545 @@ +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +public class App extends javax.swing.JFrame { + private int totalBelanja = 0; + /** + * Creates new form App + */ + public App() { + initComponents(); + loadData(); + } + + private void loadData() { + // Konfigurasi koneksi database + String url = "jdbc:mysql://localhost:3306/db_produk"; + String username = "root"; + String password = ""; + + // Koneksi ke database + try (Connection conn = DriverManager.getConnection(url, username, password)) { + // Statement untuk menjalankan query + Statement stmt = conn.createStatement(); + + // Query untuk mengambil data dari tabel + String query = "SELECT * FROM tb_produk"; + + // Eksekusi query dan ambil hasilnya + ResultSet rs = stmt.executeQuery(query); + + // Buat model tabel + DefaultTableModel model = (DefaultTableModel) tabel.getModel(); + + // Hapus semua baris yang ada di tabel + model.setRowCount(0); + + // Loop melalui hasil query dan tambahkan data ke dalam model tabel + while (rs.next()) { + int id = rs.getInt("ID"); + String nama = rs.getString("NAMA"); + long harga = rs.getLong("HARGA"); + int jumlah = rs.getInt("JUMLAH"); + + // Tambahkan data ke dalam baris baru pada model tabel + model.addRow(new Object[]{id, nama, harga, jumlah}); + } + + // Tutup statement dan result set + stmt.close(); + rs.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jPanel1 = new javax.swing.JPanel(); + jPanel2 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + jScrollPane1 = new javax.swing.JScrollPane(); + tabel = new javax.swing.JTable(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + textNama = new javax.swing.JTextField(); + textHarga = new javax.swing.JTextField(); + textJumlah = new javax.swing.JTextField(); + buttonTambah = new javax.swing.JButton(); + buttonHapus = new javax.swing.JButton(); + buttonClear = new javax.swing.JButton(); + jPanel3 = new javax.swing.JPanel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + textTotal = new javax.swing.JTextField(); + textTunai = new javax.swing.JTextField(); + textKembali = new javax.swing.JTextField(); + buttonSimpan = new javax.swing.JButton(); + buttonBayar = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); + + jPanel2.setBackground(new java.awt.Color(102, 102, 102)); + jPanel2.setForeground(new java.awt.Color(51, 51, 51)); + + jLabel1.setFont(new java.awt.Font("Comic Sans MS", 0, 18)); // NOI18N + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setText("CASH-COMP"); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + tabel.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 [] { + "ID", "NAMA", "HARGA", "JUMLAH" + } + ) { + Class[] types = new Class [] { + java.lang.Integer.class, java.lang.String.class, java.lang.Long.class, java.lang.Integer.class + }; + + public Class getColumnClass(int columnIndex) { + return types [columnIndex]; + } + }); + jScrollPane1.setViewportView(tabel); + + jLabel2.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N + jLabel2.setForeground(new java.awt.Color(255, 255, 255)); + jLabel2.setText("Nama Barang"); + + jLabel3.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N + jLabel3.setForeground(new java.awt.Color(255, 255, 255)); + jLabel3.setText("Harga Barang"); + + jLabel4.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N + jLabel4.setForeground(new java.awt.Color(255, 255, 255)); + jLabel4.setText("Jumlah Barang"); + + textNama.setBackground(new java.awt.Color(102, 102, 102)); + textNama.setForeground(new java.awt.Color(102, 102, 102)); + + textHarga.setBackground(new java.awt.Color(102, 102, 102)); + + textJumlah.setBackground(new java.awt.Color(102, 102, 102)); + textJumlah.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + textJumlahActionPerformed(evt); + } + }); + + buttonTambah.setBackground(new java.awt.Color(102, 102, 102)); + buttonTambah.setText("ADD"); + buttonTambah.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + String nama = textNama.getText(); + String hargaStr = textHarga.getText(); + String jumlahStr = textJumlah.getText(); + + long harga = Long.parseLong(hargaStr); + int jumlah = Integer.parseInt(jumlahStr); + + String url = "jdbc:mysql://localhost:3306/db_produk"; + String username = "root"; + String password = ""; + + try (Connection conn = DriverManager.getConnection(url, username, password)) { + String query = "INSERT INTO tb_produk (NAMA, HARGA, jumlah) VALUES (?, ?, ?)"; + PreparedStatement pstmt = conn.prepareStatement(query); + pstmt.setString(1, nama); + pstmt.setLong(2, harga); + pstmt.setInt(3, jumlah); + pstmt.executeUpdate(); + pstmt.close(); + + // Mengosongkan field setelah menambahkan produk + textNama.setText(""); + textHarga.setText(""); + textJumlah.setText(""); + + // Memuat ulang data + loadData(); + } catch (SQLException e) { + e.printStackTrace(); + JOptionPane.showMessageDialog(null, "Gagal menambahkan data"); + } + } + }); + + buttonHapus.setBackground(new java.awt.Color(102, 102, 102)); + buttonHapus.setText("DELETE"); + buttonHapus.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + // Mendapatkan indeks baris yang dipilih + int selectedRow = tabel.getSelectedRow(); + + if (selectedRow != -1) { + // Mendapatkan nilai ID pada kolom "ID" di baris yang dipilih + int id = (int) tabel.getValueAt(selectedRow, 0); + + // Konfigurasi koneksi database + String url = "jdbc:mysql://localhost:3306/db_produk"; + String username = "root"; + String password = ""; + + // Koneksi ke database + try (Connection conn = DriverManager.getConnection(url, username, password)) { + // Statement untuk menjalankan query + Statement stmt = conn.createStatement(); + + // Query untuk menghapus data dari tabel berdasarkan ID + String query = "DELETE FROM tb_produk WHERE ID = " + id; + + // Eksekusi query + int affectedRows = stmt.executeUpdate(query); + + if (affectedRows > 0) { + // Hapus baris dari model tabel + DefaultTableModel model = (DefaultTableModel) tabel.getModel(); + model.removeRow(selectedRow); + } + // Tutup statement + stmt.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } +}); + + buttonClear.setBackground(new java.awt.Color(153, 0, 0)); + buttonClear.setText("CLEAR"); + buttonClear.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + textNama.setText(""); + textHarga.setText(""); + textJumlah.setText(""); + } + }); + + jPanel3.setBackground(new java.awt.Color(153, 153, 153)); + + jLabel5.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N + jLabel5.setForeground(new java.awt.Color(255, 255, 255)); + jLabel5.setText("Total"); + + jLabel6.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N + jLabel6.setForeground(new java.awt.Color(255, 255, 255)); + jLabel6.setText("Cash"); + + jLabel7.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N + jLabel7.setForeground(new java.awt.Color(255, 255, 255)); + jLabel7.setText("Change"); + + textTotal.setBackground(new java.awt.Color(204, 204, 204)); + + textTunai.setBackground(new java.awt.Color(204, 204, 204)); + + textKembali.setBackground(new java.awt.Color(204, 204, 204)); + + buttonSimpan.setBackground(new java.awt.Color(102, 102, 102)); + buttonSimpan.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N + buttonSimpan.setText("ADD TO CART"); + buttonSimpan.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + int selectedRow = tabel.getSelectedRow(); + + if (selectedRow != -1) { + try { + // Mendapatkan data stok pada kolom "Stok" di baris yang dipilih + int jumlah = (int) tabel.getValueAt(selectedRow, 3); + if (jumlah > 0) { + // Mengurangi stok dengan 1 + jumlah--; + + // Memperbarui stok di dalam tabel + tabel.setValueAt(jumlah, selectedRow, 3); + + // Mendapatkan ID barang dari kolom "ID" di baris yang dipilih + int id = (int) tabel.getValueAt(selectedRow, 0); + + // Menghubungkan ke database + String url = "jdbc:mysql://localhost:3306/db_produk"; + String username = "root"; + String password = ""; + Connection connection = DriverManager.getConnection(url, username, password); + + // Update stok di database + String query = "UPDATE tb_produk SET jumlah = ? WHERE id = ?"; + PreparedStatement statement = connection.prepareStatement(query); + statement.setInt(1, jumlah); + statement.setInt(2, id); + statement.executeUpdate(); + + // Lakukan sesuatu dengan stok yang telah diperbarui + + // Menutup koneksi ke database + statement.close(); + connection.close(); + } else { + System.out.println("Stok barang kosong"); + } + + double hargaBarang = Double.parseDouble(tabel.getValueAt(selectedRow, 2).toString()); + + // Menambahkan harga barang ke total belanjaan + totalBelanja += hargaBarang; + + // Memperbarui label atau field yang menampilkan total belanjaan + textTotal.setText(String.valueOf("Rp. " + totalBelanja)); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + }); + + + buttonBayar.setBackground(new java.awt.Color(102, 102, 102)); + buttonBayar.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N + buttonBayar.setText("PAY"); + buttonBayar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + String input = textTunai.getText(); + try { + int number = Integer.parseInt(input); + int totalKembalian = number - totalBelanja; + if (totalKembalian < 0){ + textKembali.setText("Uang anda tidak cukup"); + } else { + textKembali.setText(String.valueOf("RP. " + totalKembalian)); + } + + } catch (NumberFormatException ex) { + // Tangani kesalahan jika String tidak dapat diubah menjadi integer + textKembali.setText("Inputan Hanya Berupa Angka"); + } + } + }); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel7) + .addGap(18, 18, 18) + .addComponent(textKembali)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel5) + .addComponent(jLabel6)) + .addGap(35, 35, 35) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(textTotal) + .addComponent(textTunai))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(buttonSimpan) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonBayar) + .addGap(0, 43, Short.MAX_VALUE))) + .addContainerGap()) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(textTotal, 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(jLabel6) + .addComponent(textTunai, 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(jLabel7) + .addComponent(textKembali, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(buttonSimpan) + .addComponent(buttonBayar)) + .addContainerGap()) + ); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jScrollPane1) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(buttonTambah, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(buttonHapus, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(jLabel3) + .addComponent(jLabel4)) + .addGap(25, 25, 25) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(textNama, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE) + .addComponent(textHarga) + .addComponent(textJumlah))) + .addComponent(buttonClear, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addContainerGap(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.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(textNama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(textHarga, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(textJumlah, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel4)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(buttonTambah) + .addComponent(buttonHapus)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonClear)) + .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(0, 3, Short.MAX_VALUE)) + ); + + 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.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + + pack(); + setLocationRelativeTo(null); + }// </editor-fold>//GEN-END:initComponents + + private void textJumlahActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textJumlahActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_textJumlahActionPerformed + + private void buttonHapusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonHapusActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_buttonHapusActionPerformed + + /** + * @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(App.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(App.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(App.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(App.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new App().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton buttonBayar; + private javax.swing.JButton buttonClear; + private javax.swing.JButton buttonHapus; + private javax.swing.JButton buttonSimpan; + private javax.swing.JButton buttonTambah; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTable tabel; + private javax.swing.JTextField textHarga; + private javax.swing.JTextField textJumlah; + private javax.swing.JTextField textKembali; + private javax.swing.JTextField textNama; + private javax.swing.JTextField textTotal; + private javax.swing.JTextField textTunai; + // End of variables declaration//GEN-END:variables +} \ No newline at end of file