Minggu, 13 Januari 2019

Pemesanan Tiket Bus Antar Kota



Aplikasi Pemesanan Tiket Bus


Deskripsi Aplikasi

Aplikasi ini dibuat bertujuan untuk memudahkan dalam bertransaksi pemesanan atau pembelian tiket Bus.
Dengan adanya program ini dapat membantu dan mempermudah pelanggan untuk memesan tiket Bus dan dapat membantu kasir meminimalisir kesalahan dalam perhitungan dan mempercepat kinerja kasir.


Desain Frame 
 


Run Frame

Source Code
public class Tiket_Bus extends javax.swing.JFrame {

    /**
     * Creates new form Tiket_Bus
     */
    public Tiket_Bus() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        Nama = new javax.swing.JTextField();
        Alamat = new javax.swing.JTextField();
        Tujuan = new javax.swing.JComboBox();
        Dari1 = new javax.swing.JTextField();
        HariTanggal = new javax.swing.JTextField();
        JamKeberangkatan = new javax.swing.JTextField();
        NamaDanNoBus = new javax.swing.JTextField();
        Tarif = new javax.swing.JTextField();
        NoKursi = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        UangBayar = new javax.swing.JTextField();
        UangKembali = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        uangkembali = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N
        jLabel1.setText("Pemesanan Tiket");

        jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N
        jLabel2.setText("Bus Antar Kota");

        jLabel3.setText("Nama Penumpang");

        jLabel4.setText("Alamat");

        jLabel5.setText("Dari");

        jLabel6.setText("Tujuan");

        jLabel7.setText("Hari, Tanggal");

        jLabel8.setText("Jam Keberangkatan");

        jLabel9.setText("Nama dan No. Bus");

        jLabel10.setText("Tarif");

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

        Tujuan.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Pilih Kota", "Solo", "Jogjakarta", "Surabaya" }));
        Tujuan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TujuanActionPerformed(evt);
            }
        });

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

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

        jLabel12.setText("Uang Bayar");

        jLabel13.setText("No. Kursi");

        uangkembali.setText("Uang Kembali");
        uangkembali.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                uangkembaliActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(39, 39, 39)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel4)
                                            .addComponent(jLabel5))
                                        .addGap(316, 316, 316)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(Nama, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
                                    .addComponent(Alamat)
                                    .addComponent(Dari1)))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel6)
                                    .addComponent(jLabel7)
                                    .addComponent(jLabel8)
                                    .addComponent(jLabel9)
                                    .addComponent(jLabel10)
                                    .addComponent(jLabel12))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(HariTanggal, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(Tujuan, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(39, 39, 39)
                                .addComponent(jLabel13))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(24, 24, 24)
                                .addComponent(uangkembali)))
                        .addGap(124, 124, 124)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 277, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(190, 190, 190)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(Tarif)
                                    .addComponent(NoKursi)
                                    .addComponent(UangBayar)
                                    .addComponent(UangKembali)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                        .addGap(0, 0, Short.MAX_VALUE)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(NamaDanNoBus, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
                                            .addComponent(JamKeberangkatan, javax.swing.GroupLayout.Alignment.TRAILING))))))))
                .addGap(175, 175, 175))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel2)
                        .addGap(33, 33, 33)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel4))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(Nama, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(Alamat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(Dari1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(9, 9, 9)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(Tujuan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(12, 12, 12)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7)
                    .addComponent(HariTanggal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8)
                    .addComponent(JamKeberangkatan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(NamaDanNoBus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(NoKursi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(Tarif, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel12)
                    .addComponent(UangBayar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(UangKembali, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(uangkembali))
                .addContainerGap(149, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>                       

    private void AlamatActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
    }                                     

    private void Dari1ActionPerformed(java.awt.event.ActionEvent evt) {                                     
        // TODO add your handling code here:
    }                                    

    private void TarifActionPerformed(java.awt.event.ActionEvent evt) {                                     
        // TODO add your handling code here:
    }                                    

    private void TujuanActionPerformed(java.awt.event.ActionEvent evt) {                                      
        // TODO add your handling code here:
        String tujuan="", harga;
        if(Tujuan.getSelectedItem().equals("Solo"))
        {
            tujuan="Solo";
            harga="200000";
            Tarif.setText(harga);
        } else if(Tujuan.getSelectedItem().equals("Jogjakarta"))
        {
            tujuan="Jogjakarta";
            harga="250000";
            Tarif.setText(harga);
        } else if(Tujuan.getSelectedItem().equals("Surabaya"))
        {
            tujuan="Surabaya";
            harga="300000";
            Tarif.setText(harga);
        } else{
            tujuan="Pilih Kota";
            harga="";
            Tarif.setText(harga);
           
        }
    }                                     

    private void uangkembaliActionPerformed(java.awt.event.ActionEvent evt) {                                           
        // TODO add your handling code here:
        int tarif=Integer.parseInt(Tarif.getText());
        int uangbayar=Integer.parseInt(UangBayar.getText());
        int uangkembali=(uangbayar-tarif);
        UangKembali.setText(""+uangkembali);
    }                                          

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

    // Variables declaration - do not modify                    
    private javax.swing.JTextField Alamat;
    private javax.swing.JTextField Dari1;
    private javax.swing.JTextField HariTanggal;
    private javax.swing.JTextField JamKeberangkatan;
    private javax.swing.JTextField Nama;
    private javax.swing.JTextField NamaDanNoBus;
    private javax.swing.JTextField NoKursi;
    private javax.swing.JTextField Tarif;
    private javax.swing.JComboBox Tujuan;
    private javax.swing.JTextField UangBayar;
    private javax.swing.JTextField UangKembali;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JButton uangkembali;
    // End of variables declaration                  
}
 




Sabtu, 22 Desember 2018

Aplikasi Kasir Toko Elektronik

Aplikasi ini dibuat bertujuan untuk memudahkan dalam ber transaksi jual beli Elektronik

dengan adanya program ini, dapat membantu kasir meminimalisir salah perhitungan dan mempercepat kinerja kasir. 


Flowchart


Source Code

 

 /*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package kasir;


/**

 *
 * @author Mamet
 */
import java.util.Scanner;
public class Kasir {

    /**

     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner input = new Scanner (System.in);
        System.out.println ("_______________________________________________");
        System.out.println ("___________ Daftar Harga Elektronik ___________");
        System.out.println (" 1. Kulkas Sanyo 2pintu    :       Rp.2.700.000");
        System.out.println (" 2. Mesin Cuci AQuos       :       Rp.2.500.000");
        System.out.println (" 3. TV LG 42 inch          :       Rp.3.000.000");
        System.out.println ("_______________________________________________");
       
        int Harga = 0;
        int HargaBarang[] = {2700000, 2500000, 3000000};
        String Barang;
        int Harganya;
       
        for (String a = "Y"; a.equals("Y")||a.equals("y");)
        {
         System.out.println("_______________________________________________________________________________");
        System.out.print("Masukkan Nomor Barang : ");
        int inputbarang = input.nextInt();
        System.out.print("Masukkan Banyak Barang : ");
        int Jumlah = input.nextInt();
        System.out.println("_______________________________________________________________________________");
       
       
        if(inputbarang == 1)
        {
            Barang = " Kulkas Sanyo 2pintu ";
            Harga = Harga + HargaBarang[0] * Jumlah;
            Harganya = HargaBarang [0] *Jumlah;
            System.out.println("Barang Yang Anda Pesan Adalah : " + Barang +" x"+ Jumlah+" | Rp. "+ Harganya);
           
           
        }
        else if(inputbarang == 2)
        {
            Barang = " Mesin Cuci AQuos ";
            Harga = Harga + HargaBarang[1] * Jumlah;
            Harganya = HargaBarang [1] *Jumlah;
            System.out.println("Barang Yang Anda Pesan Adalah : " + Barang +" x"+ Jumlah+" | Rp. "+ Harganya);
           
 
        }
        else if(inputbarang == 3)
        {
            Barang = " TV LG 42 inch  ";
            Harga = Harga + HargaBarang[2] * Jumlah;
            Harganya = HargaBarang [2] *Jumlah;
            System.out.println("Barang Yang Anda Pesan Adalah : " + Barang +" x"+ Jumlah+" | Rp. "+ Harganya);
           
        }
        else
        {
            System.out.println("Barang Yang Anda Pilih Belum Tersedia");
        }
        System.out.println("Apakah Anda Mau Membeli Barang Yang Lain ? Y/T");
        a = input.next();
        }
        System.out.println("_______________________________________________________________________________");
        System.out.println("Total Belanja Anda Rp." +Harga+".");
        System.out.println("Terimakasih Telah Berbelanja Di Toko Kami.");
    }
   
}


Screenshoot Program