문제

SWT 테이블 안에는 많은 테이블이 있습니다. 나는 그들 중 하나를 인덱스 X에서 index y로 옮기고 싶습니다. 그렇게 할 방법이 있습니까? 어떻게?

감사.

도움이 되었습니까?

해결책

나는 이것을하는 직접적인 방법이 있다고 생각하지 않습니다. 그러나 해결 방법으로 아래 방법을 시도하십시오. 한 번도 비슷한 것을 사용했습니다.

public void moveTableItem(Table table, int from, int to) {
    TableItem item2Move = table.getItem(from);
    TableItem newTableItem = new TableItem(table, SWT.NONE, to);
    newTableItem.setText(item2Move.getText());
    // You may want to clone the entire item here; and not just the text.

    // Dispose off, the old item.
    item2Move.dispose();

}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top