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

Tutorial atau Cara Menambahkan Palette yang Belum Tersedia di Netbeans

Ini juga gak kalah mudahnya, tapi semoga bermanfaat karena berbagi itu gak ada yang sia-sia. (yang di praktekkan menambahkan palette jDateTimePicker. Berikut langkah-langkahnya : 1.      Pada menu bar Tools pilih Palette > pilih Swing/AWT Components. 2.        Setelah muncul tampilan seperti dibawah klik Add From Jar. 3.        Cari file Calendar.jar yang sudah anda download/simpan, jika belum punya silahkan temen2 download dulu di >> Download Kemudian klik Next. 4.        Pilih Available Components JDateTimePicker, Kemudian klik Next. 5.        Pilih palette categories tempat untuk menyimpan hasil penambahan palette jDateTimePicker nya, disini saya pilih Swing Controls Klik Finish. Form yang masih terbuka close saja.  6.        Cek di palette Swing Contr...

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...