Java 如何更新SWT表中特定行中的数据
如何更新Java 如何更新SWT表中特定行中的数据,java,swt,Java,Swt,如何更新SWT表中特定行索引中的TableItem 我加载一个充满数据的表,双击它将它们加载到多个组件中,并希望将信息更新到同一行中 有人能帮帮我吗。使用 public TableItem(Table parent, int style, int index) 构造器。这允许您指定新项的行索引 这是假设您只使用表格和表格项目,而不是JFace表格查看器使用 public TableItem(Table parent, int style, int index) 构造器。这允许您指定新项的行索
SWT
表中特定行索引中的TableItem
我加载一个充满数据的表,双击它将它们加载到多个组件中,并希望将信息更新到同一行中
有人能帮帮我吗。使用
public TableItem(Table parent, int style, int index)
构造器。这允许您指定新项的行索引
这是假设您只使用表格
和表格项目
,而不是JFace表格查看器
使用
public TableItem(Table parent, int style, int index)
构造器。这允许您指定新项的行索引
这是假设您只是使用Table
和TableItem
而不是JFaceTableViewer
要更新行,请使用相应TableItem()
的setText()
和setImage()
方法
例如:
TableItem item = table.getSelection()[ 0 ]; // assumes a single selected item
item.setText( 1, "update first column" );
// or
item.setText( new String[]{ "col 1 value", "col 2 value" } );
// or, for a single-columned table
item.setText( "updated value" );
要更新行,请使用相应的TableItem()
的setText()
和setImage()
方法
例如:
TableItem item = table.getSelection()[ 0 ]; // assumes a single selected item
item.setText( 1, "update first column" );
// or
item.setText( new String[]{ "col 1 value", "col 2 value" } );
// or, for a single-columned table
item.setText( "updated value" );
我想换掉它。这只是将原来的一行向下移动。有什么建议吗?另一个答案是替换现有入口谢谢你的帮助。我想替换它。这只是将原来的一行向下移动。有什么建议吗?另一个答案包括替换现有入口谢谢你的帮助。谢谢你的帮助。谢谢你的帮助。