2014-01-08 107 views
0

我創建了一個對話框類:如何更改對話框的大小?

myDailog extends Dialog 
    public myDailog (Shell parentShell, String tatgetEntity) { 
     super(parentShell) 
    } 

    @Override 
    protected Control createDialogArea(final Composite parent) { 
     final Composite body = (Composite) super.createDialogArea(parent); 
     ...//some logic to create tableViewwer 
    } 

,我不能改變對話框的大小問題(拉伸窗口)。 我需要使用不同的對話框嗎?

+1

您正在使用哪種框架? –

+0

框架是jface – user1365697

回答

1

您可能需要使用這個公共的方法來使對話之後才能調整大小:

public void setResizable(boolean resizable) 

PS我假設你正在使用這個java.awt.Dialog

+0

我正在使用jface – user1365697

+0

org.eclipse.jface.dialogs.Dialog – user1365697

+1

在這種情況下,請使用:'setShellStyle(SWT.RESIZE);'它是從類org.eclipse.jface.window繼承的方法.Window' –

1

覆蓋的org.eclipse.jface.dialogs.DialogisResizable方法:

@Override 
protected boolean isResizable() 
{ 
    return true; 
} 
相關問題