如何从另一个表单访问JTable [英] How to access to a JTable from another form
本文介绍了如何从另一个表单访问JTable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好程序员,
如何从另一种形式访问JTable,比如刷新它或其他东西?
(我在form1和form2中有一个jtable我希望刷新jtable)
hello programmers,
how can i access to a JTable from another form, like refresh it or something else ?
(i have a jtable in form1 and from form2 i wish to refresh jtable)
推荐答案
假设你的JTable实例是form1。我会创建一个公共函数来刷新该实例,并且可以从另一个表单调用该函数。
您可以调用这样的函数:
Let's say your JTable instance is in form1. I would make a public function to refresh that instance and that function could be invoked from another form.
You could invoke your function like this:
form1.RefreshMyTable();
我希望这有帮助!
I hope this helps!
这篇关于如何从另一个表单访问JTable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文