This maybe a basic question, but I am new to programming.
I have two GUI forms running at one time, UploadGui
and UploadPurchaseData
. I need the UploadPurchaseData
form to call a value from a text field in UploadGui
called txtFirstName
. UploadGui
and UploadPurchaseData
are separate jFrame files, but they are in the same project.
Here is the code I have so far for the UploadPurchaseData
button to upload the inserted values into the database
private void cmdAddPurchaseActionPerformed(java.awt.event.ActionEvent evt) {
String ps = comboPurchaseStage.getSelectedItem().toString();
int pv = Integer.parseInt(txtPropertyValue.getText());
int la = Integer.parseInt(txtLoanAmount.getText());
//here is where is need the code to reference txtFirstName from UploadGUI
}
Here is the code that opens UploadPurchaseData
at the same time as UploadGUI
is open:
private void comboLTActionPerformed(java.awt.event.ActionEvent evt) {
String lt = comboLT.getSelectedItem().toString();
if (lt == "Purchase")
{
UploadPurchaseData anotherFrame = new UploadPurchaseData();
anotherFrame.pack();
anotherFrame.setVisible(true);
}