Final Project EAS
Pemrograman Berorientasi Objek
Risky
Aswi Narni 05111740000014
I
nyoman Yoga Mahottama 05111740000159
a. Pengertian
JavaFX
adalah kumpulan package graphic dan media yang memungkinkan
developer untuk membuat aplikasi desktop. JavaFX dirilis untuk menggantikan
Swing sebagai pustaka standar GUI untuk Java SE. JavaFX
menyediakan pengaturan grafis dan media API dan memanfaatkan Graphical
Processing Unit modern melalui akselerasi perangkat keras grafis. JavaFX juga
menyediakan interface yang dapat digunakan pengembang untuk menggabungkan
animasi grafis dan UI controls.
Penggunaan JavaFX dengan teknologi berbasis JVM seperti Java, Groovy dan
JRuby. Jika pengembang memilih untuk JavaFX, tidak ada kebutuhan untuk belajar
teknologi tambahan, seperti pengetahuan sebelumnya dari salah satu teknologi
yang disebutkan di atas akan cukup baik untuk mengembangkan RIA menggunakan
JavaFX.
b. Implementasi
Pembuatan
Aplikasi “Toko Mandiri” Menggunakan 4 class yaitu penjualan, pembelian,
Database, Bukti
Memiliki
fitur -fitur:
a.
Aplikasi kasir
b.
Input ke Database
c.
Hapus data
d.
Update Data
c. Sourcode
-pembelian
import javafx.application.Application;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.scene.layout.StackPane;
import javafx.collections.*;
import javafx.scene.paint.*;
import javafx.scene.text.*;
import javafx.scene.Group;
import java.util.Random;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import java.io.FileInputStream;
public class Pembelian extends Application
{
Text textDaftar = new Text("Daftar: ");
Text textKasir = new Text("Kasir :");
Text KodeBarang = new Text("");
Text textBiaya = new Text("");
Text textJumlah = new Text("");
Text textTotalBayar = new Text("");
Text NamaBarang = new Text("");
Text BiayaBarang = new Text("");
Text TotalBiayaText = new Text("");
TextField textFieldJumlah = new TextField ();
ObservableList optionsKasir = FXCollections.observableArrayList(
"Awin",
"Yoga"
);
final ComboBox comboBoxKasir = new ComboBox(optionsKasir);
ObservableList optionsBarang = FXCollections.observableArrayList(
"1",
"2",
"3",
"4",
"5"
);
final ComboBox comboBoxBarang = new ComboBox(optionsBarang);
private int TotalBiaya;
private int Biaya;
@Override
public void start(Stage stage) throws Exception
{
Scene scene = new Scene(new Group(), 500, 350);
stage.setTitle("Toko Mandiri");
textDaftar.setFont(Font.font(18));
textKasir.setFont(Font.font(18));
KodeBarang.setFont(Font.font(18));
textBiaya.setFont(Font.font(18));
textJumlah.setFont(Font.font(18));
textTotalBayar.setFont(Font.font(18));
GridPane grid = new GridPane();
grid.setVgap(10);
grid.setHgap(10);
grid.setPadding(new Insets(10, 10, 10, 10));
grid.add(new Label("Menyediakan: "), 0, 0);
Button buttong = new Button("Lihat");
grid.add(buttong, 1,0);
buttong.setOnAction(this::buttonClicks);
grid.add(new Label("Petugas: "), 0, 1);
grid.add(comboBoxKasir, 1,1);
grid.add(new Label("Id: "), 0, 2);
grid.add(comboBoxBarang, 1,2);
EventHandler event =
new EventHandler() {
public void handle(ActionEvent e)
{
if(comboBoxBarang.getValue() == "1")
{
NamaBarang.setText("Lolipop");
BiayaBarang.setText("Rp2500");
Biaya = 2500;
}
else if(comboBoxBarang.getValue() == "2")
{
NamaBarang.setText("Air Mineral");
BiayaBarang.setText("Rp3000");
Biaya = 3000;
}
else if(comboBoxBarang.getValue() == "3")
{
NamaBarang.setText("Chiki");
BiayaBarang.setText("Rp3000");
Biaya = 3000;
}
else if(comboBoxBarang.getValue() == "4")
{
NamaBarang.setText("Permen");
BiayaBarang.setText("Rp500");
Biaya = 500;
}
else if(comboBoxBarang.getValue() == "5")
{
NamaBarang.setText("Choclate");
BiayaBarang.setText("Rp3000");
Biaya = 3000;
}
}
};
comboBoxBarang.setOnAction(event);
grid.add(new Label("Nama Barang: "), 0, 3);
grid.add(NamaBarang, 1,3);
grid.add(new Label("Harga Barang: "), 0, 4);
grid.add(BiayaBarang, 1,4);
grid.add(new Label("Jumlah Barang: "), 0, 5);
grid.add(textFieldJumlah, 1,5);
EventHandler eventJumlah = new EventHandler() {
public void handle(ActionEvent e)
{
TotalBiaya = Integer.parseInt(textFieldJumlah.getText()) * Biaya;
TotalBiayaText.setText("Rp"+Integer.toString(TotalBiaya));
}
};
textFieldJumlah.setOnAction(eventJumlah);
grid.add(new Label("Total Bayar: "), 0, 6);
grid.add(TotalBiayaText, 1,6);
Text title=new Text("toko Mandiri");
title.setFont(Font.font(36));
Button buttons = new Button("cetak");
grid.add(buttons, 3,7);
buttons.setOnAction(this::buttonClick);
Group root = (Group)scene.getRoot();
root.getChildren().add(grid);
stage.setScene(scene);
stage.show();
buttong.setOnAction(new EventHandler() {
@Override public void handle(ActionEvent ee){
Penjualan p = new Penjualan();
p.setVisible(true);
}
});
}
public static void main(String[] args) {
Application.launch(args);
}
private void buttonClicks(ActionEvent ee)
{
Penjualan p = new Penjualan();
}
private void buttonClick(ActionEvent event)
{
Bukti c = new Bukti(NamaBarang, textFieldJumlah.getText(), TotalBiayaText);
c.show();
}
}
-penjualan
import java.awt.Component;
import java.awt.Dimension;
import java.awt.HeadlessException;
import java.awt.Toolkit;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
public class Penjualan extends javax.swing.JFrame {
private ResultSet result;
private Connection conek;
private Statement state;
public void koneksi()
{
try {
Class.forName("com.mysql.jdbc.Driver");
conek=DriverManager.getConnection("jdbc:mysql://localhost:3306/daftarbarangg", "root", "");
state=conek.createStatement();
}
catch (ClassNotFoundException | SQLException e) {
JOptionPane.showMessageDialog(null, e);
}
}
public Penjualan()
{
setTitle("Toko Mandiri");
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = getSize();
setLocation(
(screenSize.width - frameSize.width) / 2,
(screenSize.height - frameSize.height) / 2);
Display();
koneksi();
tabel();
}
private void empty()
{
id.setText("");
nama.setText("");
merk.setText("");
stok.setText("");
hrg.setText("");
id.requestFocus();
}
public void tabel(){
DefaultTableModel x = new DefaultTableModel ();
x.addColumn("ID Barang");
x.addColumn("Nama Barang");
x.addColumn("Merk");
x.addColumn("Stok");
x.addColumn("Harga");
tbl.setModel(x);
try { result=state.executeQuery("select * from barang");
while (result.next()) {
x.addRow(new Object[]{ result.getString("ID_Barang"),
result.getString("Nama_Barang"),
result.getString("Merk"),
result.getString("Stok"),
result.getString("Harga")
} );
}
}catch (SQLException e) {
JOptionPane.showMessageDialog(null, e);
}
}
private void Display()
{
id= new javax.swing.JTextField();
nama= new javax.swing.JTextField();
merk= new javax.swing.JTextField();
stok= new javax.swing.JTextField();
hrg= new javax.swing.JTextField();
Cari = new javax.swing.JButton();
Reset = new javax.swing.JButton();
Simpan = new javax.swing.JButton();
Hapus = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
tbl = new javax.swing.JTable();
Ganti = new javax.swing.JButton();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel1.setText("ID Barang");
jLabel2.setText("Nama Barang");
jLabel3.setText("Brand");
jLabel4.setText("Stok");
jLabel8.setText("Harga");
Simpan.setText("Simpan");
Simpan.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt){
SimpanActionPerformed(evt);
}
}
);
Hapus.setText("Hapus");
Hapus.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
HapusActionPerformed(evt);
}
}
);
tbl.setGridColor(new java.awt.Color(0, 0, 0));
jScrollPane1.setViewportView(tbl);
Ganti.setText("Ganti");
Ganti.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
GantiActionPerformed(evt);
}
}
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 554, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(Simpan)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(Ganti)
.addGap(14, 14, 14)
.addComponent(Hapus))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE)
.addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(id, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
.addComponent(nama)
.addComponent(merk)
.addComponent(stok)
.addComponent(hrg))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(Reset, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Cari, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0,0,0)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(17, 17, 17)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(id, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Cari)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(nama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Reset))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(merk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(stok, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel8)
.addComponent(hrg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Simpan)
.addComponent(Hapus)
.addComponent(Ganti))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(24, 24, 24))
);
pack();
}
private void ResetActionPerformed(java.awt.event.ActionEvent evt) {
empty();
}
private void GantiActionPerformed(java.awt.event.ActionEvent evt)
{
koneksi();
try {
state.executeUpdate("update barang set"
+" ID_Barang='"+id.getText()+"',"
+" Nama_Barang='"+nama.getText()+"',"
+" Merk='"+merk.getText()+"',"
+ "Stok='"+stok.getText()+"',"
+ "Harga='"+hrg.getText()+"'"
+ " where " + "ID_Barang='"+id.getText()+"'" );
empty();
tabel();
JOptionPane.showMessageDialog(null, "Data Terupdate");
}catch (SQLException | HeadlessException e) {
JOptionPane.showMessageDialog(null, "Data Belum Lengkap : "+e);
}
}
private void HapusActionPerformed(java.awt.event.ActionEvent evt) {
koneksi();
try {
state.executeUpdate("delete from barang where "
+ "ID_Barang='"+id.getText()
+"'" );
empty();
tabel();
JOptionPane.showMessageDialog(null, "Berhasil Dihapus");
} catch (HeadlessException | SQLException e) {
JOptionPane.showMessageDialog(null, "Gagal Dihapus/Koneksi Terputus "+e);
}
}
private void SimpanActionPerformed(java.awt.event.ActionEvent evt) {
koneksi();
try {
state.executeUpdate("insert into barang values ("
+ "'" + id.getText()+"',"
+ "'" + nama.getText()+"',"
+ "'" + merk.getText()+"',"
+ "'" + stok.getText()+ "',"
+ "'" + hrg.getText()+ "')" );
empty();
tabel();
JOptionPane.showMessageDialog(null, "Data Tersimpan");
}
catch (SQLException | HeadlessException e) {
JOptionPane.showMessageDialog(null, "Data KurangLengkap");
}
}
public static void main(String args[]) {
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(Penjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Penjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Penjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Penjualan.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Penjualan().setVisible(true);
}
});
}
private javax.swing.JButton Cari;
private javax.swing.JButton Ganti;
private javax.swing.JButton Hapus;
private javax.swing.JButton Reset;
private javax.swing.JButton Simpan;
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.JLabel jLabel8;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextField id;
private javax.swing.JTextField nama;
private javax.swing.JTextField merk;
private javax.swing.JTable tbl;
private javax.swing.JTextField stok;
private javax.swing.JTextField hrg;
}
-bukti
import javafx.application.Application;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.scene.layout.StackPane;
import javafx.collections.*;
import javafx.scene.paint.*;
import javafx.scene.text.*;
import javafx.scene.Group;
import java.util.Random;
public class Bukti
{
private Text NamaBarang = new Text(""),TotalHargaText = new Text("");
private String jumlahBeli;
public Bukti(Text namaBarang, String jumlah, Text TotalHarga)
{
NamaBarang = namaBarang;
TotalHargaText = TotalHarga;
jumlahBeli = jumlah;
}
public void show()
{
Stage stage = new Stage();
Scene scene = new Scene(new Group(), 500,500);
stage.setTitle("Nota Pembelian");
GridPane grid = new GridPane();
grid.setVgap(10);
grid.setHgap(15);
grid.setPadding(new Insets(10, 10, 10, 10));
grid.add(new Label("Toko Mandiri"),0,0);
grid.add(NamaBarang,0,1);
grid.add(new Label(jumlahBeli),1,1);
grid.add(new Label("Harga"),0,2);
grid.add(TotalHargaText,1,2);
Group root = (Group)scene.getRoot();
root.getChildren().add(grid);
stage.setScene(scene);
stage.show();
}
}
-Database
import java.sql.*;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;
public class Database {
static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
static final String DB_URL = "jdbc:mysql://localhost/";
static final String USER = "root";
static final String PASS = "";
public static void main(String[] args) {
Connection conn = null;
Statement stmt = null;
try{
//STEP 2: Daftarkan JDBC driver
Class.forName("com.mysql.jdbc.Driver"); //driver JDBC
//STEP 3: Koneksi ke database
System.out.println("Koneksi ke database...");
conn = DriverManager.getConnection("jdbc:mysql://localhost/","root", "");
//STEP 4: tambahkan ke Query
System.out.println("Membuat database...");
stmt = conn.createStatement();
//STEP 5 : membuat database
String sql = "CREATE DATABASE daftarbarangg";
stmt.executeUpdate(sql);
System.out.println("Database berhasil dibuat...");
//membuat table pada database yang dibuat
//STEP 1: mengkoneksikan database yang telah dibuat diatas
System.out.println("Sedang koneksi ke database yang terpilih...");
conn = DriverManager.getConnection("jdbc:mysql://localhost/daftarbarangg","root" ,"");
System.out.println("Koneksi ke database berhasil...");
//STEP 2: Tambahkan ke Query
System.out.println("Membuat Table pada Database...");
stmt = conn.createStatement();
//STEP 3: Membuat Field-Field pada Table barang
String tab = "CREATE TABLE barang " +
"(ID_Barang INTEGER not NULL, " + //Field id barnang type Integer
" Nama_Barang VARCHAR(255), " + //field nama barang type VARCHAR Lenght 255
" Merk VARCHAR(255), " + //field merk type Varchar lenght 255
" Stok INTEGER, " + //field stok type integez
" Harga INTEGER, " +//field harga type integez
" PRIMARY KEY ( ID_Barang ))"; //id barang sebagai Primary Key
stmt.executeUpdate(tab);
System.out.println("Table berhasil dibuat pada database yang terpilih...");
}catch(SQLException se){
//Menangani kesalahan untuk JDBC
se.printStackTrace();
}catch(Exception e){
//Menangani kesalahan pada Class.forName
e.printStackTrace();
}finally{
//akhir dari program yang digunakan
try{
if(stmt!=null)
stmt.close();
}catch(SQLException se2){
}
try{
if(conn!=null)
conn.close();
}catch(SQLException se){
se.printStackTrace();
}
}
System.out.println("Selesai");
}
}
d.Langkah kerja
1. Run Program menampilka halaman yang diakses kasir
2. Kasir menginput jumlah barang
3. Sistem menghitung jumlah Harga
4. Mencetak total pembelian
5. Klik lihat untuk menampilkan halaman admin mengedit, delete, menambah