2
다른 컴포지트 (대화 상자 영역) 안에있는 컴포지트 (컨테이너)가 있습니다. 컨테이너에는 몇 가지 UI 요소가 포함되어 있습니다. 대화 상자의 크기를 더 크게 만들거나 크기를 조정할 수있는 방법은 무엇입니까? 당신이에 폭 또는 높이 힌트를 설정할 수 있습니다 열 때자바에서 Resizeble 대화 SWT
@Override
protected boolean isResizable() {
return true;
}
대화를 크게하려면 여기 isResizable
방법에 대한 재정의를 추가 JFace는 대화 상자가 크기를 조정할 수 있도록하려면
protected Control createDialogArea(Composite parent) {
setMessage("Enter user information and press OK");
setTitle("User Information");
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayout(new GridLayout(2, false));
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
Label lblUserName = new Label(container, SWT.NONE);
lblUserName.setText("User name");
txtUsername = new Text(container, SWT.BORDER);
txtUsername.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
txtUsername.setEditable(newUser);
txtUsername.setText(name);
return area;
}