从另一个类的JPanel文本字段中获取价值 [英] Get value from JPanel textfield in another class

查看:51
本文介绍了从另一个类的JPanel文本字段中获取价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 JPanel 和文本框,在另一个面板中有保存按钮.如果我点击保存按钮我必须获取第一个面板文本框的值.

I have JPanel with text box, save button in another panel. If I click the save button I have to get the 1st panel text box value.

如何访问它?

推荐答案

只需将TextField设置为Public Static dats.然后,您可以使用ClassName.TextFiledName

Just make the TextField as Public Static dats it. And then u can Access the TextField Using ClassName.TextFiledName

这篇关于从另一个类的JPanel文本字段中获取价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆