如何将jtable绑定到netbeans 7中的数据库表 [英] how bind the jtable to table of database in netbeans 7

查看:133
本文介绍了如何将jtable绑定到netbeans 7中的数据库表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我有一个jframe和一个jtable
我想将表绑定到jtable
我该怎么办?
tnx

我尝试了这个 http://netbeans.dzone.com/news/binding-jtable-swing-controls- [^ ]

但是当我单击将数据导入到表单..."时,显示错误:
不允许将数据导入默认程序包中的表单中"

并尝试使用此 https://blogs.oracle.com/NetBeansSupport/entry/populating_jtable_from_mysql_database [解决方案

您需要制作适当的软件包.

正确的书面代码以程序包形式组织,因此有可能在出现错误时查找某些内容.

我通常根据功能将其分为几个包:

-XX.XX.app(应用启动器,一般情况)
-xx.xx.manager(适用于通常与数据相关的类,例如DB连接器等)
-xx.xx.handler(用于操作处理)
-xx.xx.view(用于GUI)
-xx.xx.view.workbench(我正在RCP中开发)

这些软件包的每一个在下面都有更多的软件包,因此我得到了一个井井有条的工作台.


hi I have a jframe and a jtable
and i want bind the table to jtable
how can i do it?
tnx

i try this
http://netbeans.dzone.com/news/binding-jtable-swing-controls-[^]

but when i Click on "Import Data to Form..." show a error:
"Importing data into a form in the default package is not allowed"

and try this https://blogs.oracle.com/NetBeansSupport/entry/populating_jtable_from_mysql_database[^] but the table can''t drag to the jtable

解决方案

You need to make proper packages.

Proper written code is organized in packages, that makes it possible to find something when an error appears.

I normally divide in several packages according of the function:

- XX.XX.app (app starter, general things)
- xx.xx.manager (for general, often data related classes like DB connector etc)
- xx.xx.handler (for action handling)
- xx.xx.view (for the GUI)
- xx.xx.view.workbench (I''m developing in RCP)

Each of these Packages has more packages underneath, so I get a pretty well organized workbench.


这篇关于如何将jtable绑定到netbeans 7中的数据库表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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