Skip to main content

Source code program makes Login system with Netbeans

Source code program makes Login system with Netbeans

Login system makes the keypad / button that can not access / click can be activated and can be accessed / click .
1.      Design main display form as in the picture below

#Sub menu Login will be changed automatically be Logout when Login was successful.
#all key / button is not active ( enabled = false ) .
 
2.      Create a database ( I'm using MySQL ) , following the example of the database structure to table his admin

3.      Do not forget Add Library MySQL JDBC drivers , how to stay right-click on Libraries > Select the Add Library to display the following

4.      If the MySQL JDBC Driver has not any , click the Import button and locate the file its MySQL JDBC Driver and then select the file and press Ok .After successfully import , select the file again its MySQL JDBC Driver and then click the Add Library
5.      For the system source code Login Login Button Right click > Events > Action > actionPerformed then type the following code
 
try {
            Connection koneksi=DriverManager.getConnection("jdbc:mysql://localhost:3306/medica","root","");
            Statement stat= koneksi.createStatement();
            ResultSet rs=stat.executeQuery("select count(id_admin) from admin where id_admin='"+jPasswordUser.getText()+"' and password='"+jPasswordPass.getText()+"'" );
            if(rs.next()){
                int id_admin=rs.getInt(1);
                if(id_admin>0){
                    TbObat.setEnabled(true);
                    TbTindakan.setEnabled(true);
                    TbDokter.setEnabled(true);
                    TbPasien.setEnabled(true);
                    TbPetugas.setEnabled(true);
                    Login.setText("Logout");       //merubah sub menu Login menjadi Logout
                    PanelLogin.setVisible(false);
                    jPasswordPass.setText("");
                    jPasswordUser.setText("");
                }else {
                    TbObat.setEnabled(false);
                    TbTindakan.setEnabled(false);
                    TbDokter.setEnabled(false);
                    TbPasien.setEnabled(false);
                    TbPetugas.setEnabled(false);
                    Login.setText("Login");
                    JOptionPane.showMessageDialog(null,"Maaf, Username atau Password SALAH,Silahkan ulangi Login...!");
                    jPasswordUser.setFocusable(true);
                    jPasswordPass.setText("");
                    jPasswordUser.setText("");
                }
            }
        } catch (SQLException ex) {
            System.out.println(ex);
        }
#Description: The name of the database , table , field , button , TextField , form Login adjust to have each of you .
 
6.      Later on also click the Right Button Cancel > Events > Action > actionPerformed then type the following code :
  jPasswordPass.setText("");
        jPasswordUser.setText("");
        PanelLogin.setVisible(false);
 
7.      Try the program in the Run and see the results !
- The initial view when the sub menu Log in clicks , all the key / button is not active as yet Login

- Display when Button click Login and Login successful , turned into a sub menu Login Logout automatic and all key / button is active

- Display as Username and Password are entered incorrectly , the textfield will return empty . When the Cancel button is clicked Login form will disappear

that interest project / source code please download
if you want e -book please download e-book

good luck and HAPPY CODING : D
 

Comments

Popular posts from this blog

Source code program SIMRS/Rekam Medis (khusus poliklinik ibu dan anak) dengan java netbeans #tambahan2

Ada tambahan pada Source code program beserta database nya sudah ready hehee... Design tampilan menggunakan jTatto, sebelum program di Run add file jar jTatto nya ke Libraries, caranya ya download dulu file jTatto.jar , buka project nya, klik kanan Libraries > pilih Add jar/folder > cari file jTatto.jar > Open. Program ini sudah lengkap dengan inner join tabelnya, login/logout dan cetak laporan/report, Berikut hasil Screen Shoot nya, temen2 silahkan kembangkan sendiri dan ubah designnya sesuai selera masing2! 1. Tampilan sebelum login 2. Tampilan input data admin 2. Tampilan input data pasien ibu 3. Tampilan input data pasien mati ibu 4. Tampilan input data pasien bayi 5. Tampilan input data pasien mati bayi 6. Tampilan input data penyakit 7. Tampilan input data kamar 8. Tampilan input data tindakan 9. Tampilan input data rawat inap bayi 10. Tampilan input data rawat inap ibu 11. Tampilan input data imun...

Contoh Analisis dan Perancangan Sistem Informasi Klinik atau Rumah Sakit (Diagram Konteks, DFD/DAD, Flowchart System)

Assalamu'alaikum... Mencoba berbagi lagi, irna pengen bahas tentang bagaimana merancang sistem (analisys system) pembuatan sebuah Sistem Informasi Klinik atau bisa juga Rumah Sakit tapi dalam lingkup kecil. Yang mau irna bahas dari pembuatan Diagram Konteks, Data Flow Diagram (DFD) atau Diagram Alir Data (DAD) dari level 1 sampai level 3 dan Flowchart System nya. Yupzt berikut hasil screen shoot gambar-gambarnya : >> Diagram Konteks atau Kontext Diagram Sistem Informasi Klinik atau Rumah Sakit : >> DFD (Data Flow Diagram) atau DAD (Diagram Alir Sistem Sistem) Level 1 Sistem Informasi Klinik atau Rumah Sakit : >> DFD (Data Flow Diagram) atau DAD (Diagram Alir Sistem Sistem) Level 2 Input Data Sistem Informasi Klinik atau Rumah Sakit : >> DFD (Data Flow Diagram) atau DAD (Diagram Alir Sistem Sistem) Level 2 Proses atau Transaksi Sistem Informasi Klinik atau Rumah Sakit : >> DFD (Data Flow Diagram) atau DAD (Diagram Ali...

Membuat Login Multiuser atau Multi Level User (berbeda hak akses) Java Dekstop

Bismillah.. Dalam pembuatan system, terutama yang berbasis client-server tentu nya hak akses setiap petugas berbeda, oleh karena itu dibutuhkan login yang multiuser atau multi level user. Berikut langkah-langkah pembuatannya pada pemrograman java desktop NetBeans IDE.   1.       Design tampilan form utama seperti pada gambar di bawah : #Sub menu Login akan berubah otomatis menjadi Logout ketika Login sudah berhasil. #semua tombol/button tidak aktif (enable=false). 2.         Buat sebuah database (saya menggunakan MySQL), berikut contoh struktur database untuk table admin nya : 3.         Jangan lupa Add Library MySQL JDBC Driver nya, caranya tinggal klik kanan pada Libraries > Pilih Add Library sehinggan muncul tampilan berikut : Jika MySQL JDBC Driver nya belum ada, klik tombol Import dan cari file MySQL JDBC Driver nya kemudian pilih filenya lalu tekan Ok. Se...