Header Ads

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!

No comments

Thank you very much for your ideas!