private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        // TODO add your handling code here:
        String NIM = jTextField1.getText();
        String Nama = jTextField2.getText();
        String Jurusan = jTextField3.getText();
        String Alamat = jTextArea1.getText();
        
        final String JDBC_DRIVER = "com.mysql.jdbc.Driver";  
        final String DB_URL = "jdbc:mysql://localhost/perpus";

        //  Database credentials
        final String USER = "root";
        final String PASS = "";
   
        Connection conn = null;
        Statement stmt = null;
        try{
           //STEP 2: Register JDBC driver
           Class.forName("com.mysql.jdbc.Driver");

           //STEP 3: Open a connection
           System.out.println("Connecting to a selected database...");
           conn = DriverManager.getConnection(DB_URL, USER, PASS);
           System.out.println("Connected database successfully...");

           //STEP 4: Execute a query
           System.out.println("Inserting records into the table...");
           stmt = conn.createStatement();

           String sql = "INSERT INTO anggota " +
                        "VALUES ('"+NIM+"', '"+Nama+"', '"+Jurusan+"', '"+Alamat+"')";
           stmt.executeUpdate(sql);
           System.out.println("Inserted records into the table...");
          
           isiTabel();
        }catch(SQLException se){
           //Handle errors for JDBC
           se.printStackTrace();
        }catch(Exception e){
           //Handle errors for Class.forName
           e.printStackTrace();
        }finally{
           //finally block used to close resources
           try{
              if(stmt!=null)
                 conn.close();
           }catch(SQLException se){
           }// do nothing
           try{
              if(conn!=null)
                 conn.close();
           }catch(SQLException se){
              se.printStackTrace();
           }//end finally try
        }//end try
    }//GEN-LAST:event_jButton8ActionPerformed