2013-10-10 3 views
1

내 GUI의 두 번째 열 (작업 이름)에 jface TreeViewer를 삽입하려고하지만 첫 번째 열 (작업 ID)과 통합됩니다. 어떻게 컨트롤을 하나의 열에서 두 번째 열로 옮길 수 있습니까?jface TreeViewer를 두 번째 또는 특정 열에 삽입하는 방법은 무엇입니까?

public static void main(String[] args) 
{ 
    final Display display = new Display(); 
    final Shell shell = new Shell(display); 
    shell.setText("StackOverflow"); 
    shell.setLayout(new GridLayout(3, true)); 

    /* Top row */ 
    new Button(shell, SWT.PUSH).setText("Button"); 
    new Label(shell, SWT.NONE); 
    new Label(shell, SWT.NONE); 

    /* Middle row */ 
    new Label(shell, SWT.NONE); 
    new Button(shell, SWT.PUSH).setText("Button"); 
    new Label(shell, SWT.NONE); 

    /* Bottom row */ 
    new Label(shell, SWT.NONE); 
    new Label(shell, SWT.NONE); 
    new Button(shell, SWT.PUSH).setText("Button"); 

    shell.pack(); 
    shell.open(); 
    while (!shell.isDisposed()) 
    { 
     if (!display.readAndDispatch()) 
     { 
      display.sleep(); 
     } 
    } 
    display.dispose(); 
} 

이 생산 :

+0

을 어느 레이아웃을 사용하고 있습니까? – Baz

+0

그리드 레이아웃을 사용 중입니다. –

답변

1

GridLayout와이를 달성하는 가장 쉬운 방법은 TreeViewer의 "앞에"공간을 차지 더미 Label의 삽입하는 것입니다

enter image description here

관련 문제