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!
Post a Comment