且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Beans 在 NetBeans 中绑定 JTable

更新时间:2023-12-04 10:00:46

我让它工作了.您不能真正使用 JTables 的绑定"菜单选项.以下是让它工作的方法:

I have it working. You can't really use the "Bind" menu option for JTables. Here's how to get it to work:

  1. 右键单击 JTable.
  2. 点击表格内容".
  1. Right-Click the JTable.
  2. Click "Table Contents".
  1. 绑定来源:表单
  2. 绑定表达式:${var}(其中 var 是 bean 列表的名称).

  • 点击列"标签.
  • 将列映射到表达式.它应该看起来像 ${id} 而不是 ${var.id}.
  • 注意:映射到列的每个字段都必须有一个 getter.

    Note: Each field mapped to a column must have a getter.