This is the first Class, the thing is that i have to receive the values from the other class triggered by the event in the button (action performed), so in this class i want to display it!
public class PanelCotizacion extends javax.swing.JPanel {
private int numCotizacion = 0;
public int getNumCotizacion() {
return numCotizacion;
}
public void setNumCotizacion(int numCotizacion) {
this.numCotizacion = numCotizacion;
}
public PanelCotizacion() {
initComponents();
showTextFields();
}
show textFields(){
this.txtCosTra.setText(String.valueOf(cosTra));
}
}
This is the second Class, where i want to send the value that is in the jTextField, remember that i mentioned that in both jFrames, have jPanels and the jTextFields are inside of it.
public class BusquedaCotizacionGUI extends javax.swing.JFrame {
public BusquedaCotizacionGUI() {
initComponents();
this.setLocationRelativeTo(null);
}
private void cmdOKActionPerformed(java.awt.event.ActionEvent evt) {
PanelCotizacion p = new PanelCotizacion();
p.setNumCotizacion(Integer.parseInt(this.txtCotizacion.getText()));
p.setVisible(true);
p.revalidate();
p.updateUI();
this.dispose();
}
}
So please don't look the sintaxis, if you can give me an idea to solve that problem, i think maybe dont display it in the jTextFields cause are private, Are there any way to display it or How can i update the jPanel components to display the update TextFields? Thanks a lot!