I have this code:
my main Frame:
   public MainFrame() {
    initComponents();
  }
My other frame is initialized like this in my main frame:
     private void agregarAlumnoActionPerformed(java.awt.event.ActionEvent evt) {                                              
    // TODO add your handling code here:
    new AgregarAlumno().setVisible(true);
}  
which opens the second frame:
  public AgregarAlumno() {
    initComponents();
}
I then will show a text box in the second frame to input something and i would like it for it to be used by my Main Frame, i know i can send a value to the second frame like this
       new AgregarAlumno(valueX).setVisible(true);
and then on the Second Frame receive it building a constructer like this
    public AgregarAlumno(int valueX) {
    initComponents();
}
and use it in the second Frame. but how would i send back a value to the first Frame?
Thanks.
 
     
    