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,971
  • 9
  • 68
  • 98
Mythul
  • 1,807
  • 7
  • 34
  • 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
  • 22,695
  • 19
  • 92
  • 198