简体   繁体   English

将一个JFrame的文本字段值传递给另一个JFrame

[英]Pass textfield values of one JFrame to another JFrame

Hi i am new to Java and it will be a great help if someone can give me a clear solution for my question. 嗨,我是Java新手,如果有人可以为我的问题提供清晰的解决方案,这将对您有很大的帮助。

There are two JFrames in my project such as Client1 and Client2. 我的项目中有两个JFrame,例如Client1和Client2。 In client1, there are some textfields and a button named as "NEXT". 在client1中,有一些文本字段和一个名为“ NEXT”的按钮。 In Client2, there are another textields and a "Submit" button. 在Client2中,还有另一个文本对象和一个“提交”按钮。

When click Submit button, all the textfield values (both from Client1 and Client2) are saved to a database table. 单击提交按钮时,所有文本字段值(来自Client1和Client2)都保存到数据库表中。

My question is, How to pass and keep values of textfields in Client1 to Client2 for saving them in database. 我的问题是,如何将Client1中的文本字段的值传递并保留到Client2,以将其保存在数据库中。

使用构造函数创建第二个框架时,可以传递它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM