0

I have a JTextField in a LogInWindow(JFrame). In that JTextField the user enters it's name.

I have another StudentWindow (JFrame) and its constructor has that user name String as a parameter.

In my xml file how can i inject the input from the JTextField ?

<!-- GUI Beans -->
<bean id="logInWindow" class="gui.LogInWindow">
    <constructor-arg ref="controller"/>
    <property name="nameJTextField" value="?? Need help here ??"/>
</bean>

<bean id="studentWindow" class="gui.StudentWindow">
<constructor-arg ref="????????"/>
</bean> 

Thanks in advance.

StanislavL
  • 56,113
  • 9
  • 64
  • 93
Mythul
  • 1,767
  • 6
  • 33
  • 53
  • 1
    See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/questions/9554636/the-use-of-multiple-jframes-good-bad-practice) – Reimeus Dec 25 '12 at 18:24

1 Answers1

1

You can't. Spring parses the XML and creates beans based on it before either of your JFrame is ever showing. Unless I completely misunderstand your case...

Marcel Stör
  • 21,148
  • 15
  • 82
  • 185