0

Hi i am new to Java and it will be a great help if someone can give me a clear solution for my question.

There are two JFrames in my project such as Client1 and Client2. In client1, there are some textfields and a button named as "NEXT". In Client2, there are another textields and a "Submit" button.

When click Submit button, all the textfield values (both from Client1 and Client2) are saved to a database table.

My question is, How to pass and keep values of textfields in Client1 to Client2 for saving them in database.

Saji
  • 43
  • 4
  • 3
    please check [The use of multiple JFrames good bad practice](http://stackoverflow.com/questions/9554636/the-use-of-multiple-jframes-good-bad-practice/9554657#9554657) and also to [Layout Managers](http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html) especialy to [Card Layout](http://docs.oracle.com/javase/tutorial/uiswing/layout/card.html) – Frakcool Jul 01 '14 at 17:26
  • 1
    and I guess you're asking for [`getText()`](http://docs.oracle.com/javase/7/docs/api/javax/swing/text/JTextComponent.html#getText%28%29) method of `JTextField`, please before asking questions here check the **documentation** – Frakcool Jul 01 '14 at 17:28
  • 2
    In addition to @Frakcool comments, take a look to this official article: [Creating Wizard Dialogs with Java Swing](http://www.oracle.com/technetwork/articles/javase/wizard-136789.html) – dic19 Jul 01 '14 at 18:51
  • @Frakcool-im not asking about getText(). – Saji Jul 02 '14 at 10:11
  • @dic19-it was helpful for me.thank u. – Saji Jul 02 '14 at 10:11

1 Answers1

-1

You could pass them when you create the second frame using the constructor.

Marco Acierno
  • 14,682
  • 8
  • 43
  • 53