Being and Been

The word 'been' is always used after have (in any form of, e.g. hashadwill have). The word 'being' never should be used after have. It is used after to be (in any form, e.g. iswaswere). Lets see some examples to find the difference between been and being.

  • (have + been + present participle) = have been doing
  • (is + being + past participle) = is being done

Examples
  • He has been doing it for over two hours.
  • He has being done. (This sentence is wrong. being cannot use after has or have).
  • He is being done.
  • They have been playing cricket for six hours.
  • John's computer is being sold next month.
Noun
You can use being as a noun. Lets see some examples. 
  • A human being
  • A stranger being came with his space ship.
Gerund
being can also be a gerund (which is a type of noun).
  • Does she like being so ignorant?
  • We were lost the game by his being so clumsy.

Create Employee Management System using JAVA - Part 21


Advanced  search a particular data inSQLite (MySql) Database in Netbeans java jtable
In the event (20) that we have created Search, it will not give a search result under employeeid or surname.
Add this code after the the catch code. In the SELECT query you can give employeeid and surname. Then search will be optimal when you searching under these categories.

private void txt_searchKeyReleased(java.awt.event.KeyEvent evt) {
        try{
            PreparedStatement pst = conn.prepareStatement("SELECT * FROM employeeinfo WHERE name=?");
            pst.setString(1, txt_search.getText());
           
            rs = pst.executeQuery();
            if(rs.next()){
                String add1 = rs.getString("employeeid");
                txt_employeeid.setText(add1);
                String add2 = rs.getString("name");
                txt_name.setText(add2);
                String add3 = rs.getString("surname");
                txt_surname.setText(add3);
                String add4 = rs.getString("age");
                txt_age.setText(add4);
            }
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, e);
        }

try{
            PreparedStatement pst = conn.prepareStatement("SELECT * FROM employeeinfo WHERE surname=?");
            pst.setString(1, txt_search.getText());
         
            rs = pst.executeQuery();
            if(rs.next()){
                String add1 = rs.getString("employeeid");
                txt_employeeid.setText(add1);
                String add2 = rs.getString("name");
                txt_name.setText(add2);
                String add3 = rs.getString("surname");
                txt_surname.setText(add3);
                String add4 = rs.getString("age");
                txt_age.setText(add4);
            }
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, e);
        }
    }

See you on next tutorial 22 -Using Up-Down Arrow Key to Move in a jtable and get the Data in jtextfield  netbeans!

Create Employee Management System using JAVA - Part 20

How to search a particular data inSQLite (MySql) Database in Netbeans java jtable
Add a Text Field --> txt_search

private void txt_searchKeyReleased(java.awt.event.KeyEvent evt) {
        try{
            PreparedStatement pst = conn.prepareStatement("SELECT * FROM employeeinfo WHERE name=?");
            pst.setString(1, txt_search.getText());
         
            rs = pst.executeQuery();
            if(rs.next()){
                String add1 = rs.getString("employeeid");
                txt_employeeid.setText(add1);
                String add2 = rs.getString("name");
                txt_name.setText(add2);
                String add3 = rs.getString("surname");
                txt_surname.setText(add3);
                String add4 = rs.getString("age");
                txt_age.setText(add4);
            }
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, e);
        }
    }

When you type a name in Search text filed, you can view data.

See you on next tutorial 21 -Advanced  search a particular data inSQLite (MySql) Database in Netbeans java jtable!

Create Employee Management System using JAVA - Part 19

How to Use JPanel in JFrame in NetBeans Java and make GUI Presentable




















Select all the buttons at once, then right click on it --> Enclose in --> Panel. In Panel properties you can make your panel more GUI presentable as shown in the figure.

See you on next tutorial 20 - How to search a particular data inSQLite (MySql) Database in Netbeans java jtable!

Create Employee Management System using JAVA - Part 18

How to clear a JTextField with a button in Netbeans Java
When you click data in the table, the relevant data will view in the form. If you want to add new data, you have to remove one by one. 'Clear' button will reset form.
















private void btnClearActionPerformed(java.awt.event.ActionEvent evt) {
        txt_employeeid.setText("");
        txt_name.setText("");
        txt_surname.setText("");
        txt_age.setText("");
    }

See you on next tutorial 19 - How to Use JPanel in JFrame in NetBeans Java and make GUI Presentable!

Create Employee Management System using JAVA - Part 17


How to update-Edit a data in SQLite (MySql) Database in Netbeans java
Update Button:


private void btnUpdateActionPerformed(java.awt.event.ActionEvent evt) {
        try{
            String val1 = txt_employeeid.getText();
            String val2 = txt_name.getText();
            String val3 = txt_surname.getText();
            String val4 = txt_age.getText();
         
            PreparedStatement pst = conn.prepareStatement("UPDATE  employeeinfo SET "
                    + "employeeid='"+val1+"', name='"+val2+"', surname='"+val3+"', age='"+val4+"' WHERE employeeid='"+val1+"'");                    
         
            pst.executeUpdate();
            JOptionPane.showMessageDialog(null, "Updated!");
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, e);
        }
        Update_table();
    }

See you on next tutorial 18 - How to clear a JTextField with a button in Netbeans Java!

Create Employee Management System using JAVA - Part 16


Deleting Data from an SQLite (MySql) Database in Netbeans java
Add a button and rename it as 'Delete' right click --> Events --> Action --> actionPerformed


private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {
        try{
            PreparedStatement pst = conn.prepareStatement("DELETE FROM employeeinfo WHERE employeeid = ?");
            pst.setString(1, txt_employeeid.getText());
         
            pst.executeUpdate();
            JOptionPane.showMessageDialog(null, "Deleted!");
        }
        catch(Exception e){
            JOptionPane.showMessageDialog(null, e);
        }
        Update_table();
    }

See you on next tutorial 17 - .How to update-Edit a data in SQLite (MySql) Database in Netbeans java!

Create Employee Management System using JAVA - Part 15


How To Open New Jframe From A jButton in Netbeans java
Right click on the Project --> New --> JFrame Form
We named it as Userinfo_frame.java
In this page - Properties --> defaultCloseOperation == DISPOSE (this will help to close the previous frame and view new frame after clicking on the button). Give the same settings to Employee_info frame.

Add a button to Employee_info.java design and right click on the button --> Events --> Action --> actionPerformed.

Add this code:

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
        // Close previous frame before opening new frame
        close();
        
        // Open new frame
        Userinfo_frame s = new Userinfo_frame();
        s.setVisible(true);
    }

See you on next tutorial 16 - Deleting Data from an SQLite (MySql) Database in Netbeans java!

Create Employee Management System using JAVA - Part 14

How to Insert-Save data from netbeans java into database Sqlite (MySql)


When click on 'Save' button, the data will save into the table. To do this add following codes to Employee_info.java file.












  • btnSaveActionPerformed - right click on the button --> Events --> Action --> actionPerformed
  • Update_table(); // When you click save button, instantly update the table

Create Employee Management System using JAVA - Part 13

Display Time and Date In  java Netbeans

















Right click on the menu bar add select 'Add Menu' as follows. There are two menu items Date & Time, I have listed.

Add this code to Employee_info.java

public void CurrentDate(){
        Calendar cal = new GregorianCalendar();
        int month = cal.get(Calendar.MONTH);
        int year = cal.get(Calendar.YEAR);
        int day = cal.get(Calendar.DAY_OF_MONTH);
        date_txt.setText("Date-"+year+"/"+(month+1)+"/"+day); // current date
        
        int second = cal.get(Calendar.SECOND);
        int minute = cal.get(Calendar.MINUTE);
        int hour = cal.get(Calendar.HOUR);
        time_txt.setText("Time-"+hour+":"+minute+":"+second); // current time
    }

public Employee_info() {
        initComponents();
        conn = javaconnect.ConnecrDb();
        Update_table();
        Fillcombo();
        CurrentDate(); // Date & Time
    }

See you on next tutorial 14 - How to Insert-Save data from netbeans java into database Sqlite (MySql) 

Create Employee Management System using JAVA - Part 12

Add image,icon, picture to jmanuitem , jbutton, jtoolitem on java netbeans

In this tutorial, we are going to talk about how to add icons to the application 'Employee Management System'
















You can get free icon png images from this link à Icon Archive

Add an icon to the Save Button:

Right click --> Properties --> icon --> Import to Project --> Finish

Select 16*16 image size.

See you on next tutorial: 13 - Display Time and Date In  java Netbeans