Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/392.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何更新SWT表中特定行中的数据_Java_Swt - Fatal编程技术网

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
而不是JFace
TableViewer
要更新行,请使用相应
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" );

我想换掉它。这只是将原来的一行向下移动。有什么建议吗?另一个答案是替换现有入口谢谢你的帮助。我想替换它。这只是将原来的一行向下移动。有什么建议吗?另一个答案包括替换现有入口谢谢你的帮助。谢谢你的帮助。谢谢你的帮助。