This method shows a new window in my application:
public void ShowNewCustomerView() {
if (NewCustomer == null) NewCustomer = new NewCustomerView(this);
NewCustomer.setVisible(true);
}
The class NewCustomerView has this method:
public void ClearFields() {
txtAddress.setText("");
txtCity.setText("");
txtCompanyName.setText("");
txtCustomerNumber.setText("");
txtOrganisationNumber.setText("");
txtPhoneNumber1.setText("");
txtPhoneNumber2.setText("");
txtPostalCode.setText("");
txtReferenceName.setText("");
}
How can I run that method before the line:
NewCustomer.setVisible(true);
Adding this:
NewCustomer.ClearFields();
...does not work... why is that?
This is what error I get: Cannot find symbol (method ClearFields()) Class: javax.Swing.JFrame
But I created a new instance of NewCustomerView which extends JFrame?? Right?