Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经阅读了如何在代码中使用数据创建一个JTableon JScrollPane,但是如何在不向其中添加数据的情况下创建一个带有列标题的空表?
JTable
JScrollPane
我想从表单中添加数据,而不是从我的代码中。
如果您使用 Netbeans 进行开发,那么使用 JTables 将非常容易。
使用 Netbeans,只需从口味中选择 Table 并将其放在您希望显示的任何位置。
然后在属性中,您可以更改列名、添加新列和删除旧列。此外,只有您可以选择要显示的行,只需将其设置为零 (0)。
瞧!您的表已准备好列名和无行。