0

In my Java application I want to create a table whose data field will be updated dynamically. The table is not linked with any database. The tables' data fields are ArrayList or List type data so I want to update the fields when they are changing. I was looking into the jtable but was unable to find the way to do that. Anyone knows the solution is highly appreciated..

4

1 回答 1

0

我认为您应该执行以下操作

  • 为每个表创建一个类
  • 创建动态字段实现一个映射,该映射将字段的名称存储为键,并将其值存储为映射的值
  • 为每一行创建一个对象并将它们存储在列表中(如果您想进行索引,则可以映射)
  • 实现搜索功能
  • 在需要时更新它。

Jtable 是 UI 的组件,您可以轻松使用它,如果显示数据有问题,随时欢迎您询问。

于 2012-08-27T15:57:38.877 回答