this is my codes in a button that if I click it . that information will send to Jtable but the problem is the jtable is in another frame so how can i connect this ? help me plese
DefaultTableModel model = (DefaultTableModel) new admin().tableBagtags.getModel(); if (txtName.getText().equals("")) { JOptionPane.showMessageDialog(null, "Please fill out all fields.", "Error!", JOptionPane.ERROR_MESSAGE); } else if (txtAddress.getText().equals("")) { JOptionPane.showMessageDialog(rootPane, "Please fill out all fields.","Error!", JOptionPane.ERROR_MESSAGE); } else if (txtContacts.getText().equals("")) { JOptionPane.showMessageDialog(rootPane, "Please fill out all fields.","Error!", JOptionPane.ERROR_MESSAGE); } else if (txtEmail.getText().equals("")) { JOptionPane.showMessageDialog(rootPane, "Please fill all out fields.","Error!", JOptionPane.ERROR_MESSAGE); } else if (jLabel8.getText().equals("*Invalid input*")) { jLabel8.setText("Downpayment: Invalid input."); } else if (txtDesign.getText().equals("")) { JOptionPane.showMessageDialog(rootPane, "Choose your design.","Design", JOptionPane.ERROR_MESSAGE); } else if (txtDownpayment.getText().equals("")) { jLabel8.setText("Downpayment is required"); } else { JOptionPane.showMessageDialog(null, "Order Succesful."); model.addRow(new Object [] {txtName.getText(), txtAddress.getText(), txtContacts.getText(), txtEmail.getText()} ); this.dispose(); }