So, i'm building a login form in java with swing. and i did this test when login button is clicked
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String username = jTextField1.getText();
String password = jTextField2.getText();
if (username.equals("Admin")&&password.equals("Admin")) {
//Launch admin panel
AdminGui admin = new AdminGui();
admin.setVisible(true);
}
else {
//Some code
}
}
As you see if the username = Admin and the passowrd is also Admin AdminGui will launch, but i want this test to be performed at another class. How could i send the textfield values from this class to another ?