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 Sistem Informasi Rekam Medis Pada KLinik Rawat Jalan Berbasis Java Web (JSP, Servlet, JSTL)

Bismillah... Mencoba lagi meskipun masih sederhana.. Source code program ini menggunakan Netbeans 7.2 berbasis java web (JSP, JSTL, Servlet) dan menggunakan perintah SQL inner join untuk mempermudah User dalam menggunakan sistem/aplikasi ini. Bisa melakukan simpan, edit, hapus dan pencarian data. Design web nya menggunakan bahasa HTML dan CSS. Berikut hasil screen shoot tampilan program setelah di Run di Google Chrome : 1. Tampilan Home/Beranda ketika pertama kali di Run. 2. Tentang Program (Tampilan yang muncul ketika klik Menu About.) 3. Input Data Obat (tampilan ketika menu Obat di klik) 4. Input Data Dokter (tampilan ketika menu Dokter di klik) 5. Input Data Petugas (tampilan ketika menu Petugas di klik) 6. Input Data Pasien (tampilan ketika menu Pasien di klik) 7. Input Data Tarif Tindakan (tampilan ketika menu Tarif Tindakan di klik) 8. Input Data Pemberian Obat (tampilan ketika menu Pemberian Obat di klik)     Berrelasi dengan tabel Obat...

Source Code Program Aplikasi/Software Sewa Tanah Pemerintah Desa/Lungguh Desa ( JAVA DEKSTOP )

Awalnya soal UTS Pemrograman Java 1 di semester 4 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. Menu Utama sebelum Login (Sub Menu Login akan berubah menjadi Logout setelah sukses Login) 2. Form Login 3. Menu Utama setelah Login 4. Form Input Data Pegawai 5. Form Input Data Dusun 6. Form Input Data Desa 7. Form Input Data Kecamatan 8. Form Input Data Kabupaten 9. Form Input Data Provinsi 10. Form Input Data Penyewa 11. Form Input Data Pelungguh 12. Form Input Data Tanah 13. Form Input Data Sewa (Penyewaan) 14...

source code program pembuatan sistem informasi posyandu menggunakan netbeans IDE 7.2 berbasis java web

Source code program ini menggunakan Netbeans 7.2 berbasis java web (JSP, JSTL, Servlet) dan menggunakan perintah SQL inner join untuk mempermudah User dalam menggunakan sistem/aplikasi ini. Bisa melakukan simpan, edit, hapus dan pencarian data, dan juga ada fasilitas Presensi Petugas. Berikut hasil screen shoot tampilan program : 1. Menu Utama 2. Menu input data Berat Badan Bayi Timbang 3. Menu input data Petugas 4. Menu input data Posyandu (inner join dengan tabel data Kelurahan) 5. Menu input data Puskesmas (inner join dengan tabel data Kecamatan) 6. Menu input data Kelurahan (inner join dengan tabel data Puskesmas) 7. Menu input data Kecamatan 8. Menu input data Ibu (inner join dengan tabel data Posyandu) 9. Menu input data Anak (inner join dengan tabel data Ibu) 10. Menu input data Ibu Hamil (inner join dengan tabel data Ibu) 11. Menu input data Layanan Anak ( inner join dengan tabel data Anak) 12. Menu Presensi Petugas (inner join d...