user1365697
user1365697

Reputation: 5989

How to change the size of the dialog?

I created a dialog class:

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
    }

The problem that I can't change the size of the dialog (stretch the windows). Do I need to use different dialog?

Upvotes: 0

Views: 385

Answers (2)

greg-449
greg-449

Reputation: 111142

Override the isResizable method of org.eclipse.jface.dialogs.Dialog:

@Override
protected boolean isResizable()
{
  return true;
}

Upvotes: 2

Michal Rorat
Michal Rorat

Reputation: 385

You may need to use this public method to enable the dialog to be resizable:

public void setResizable(boolean resizable)

ps I'm assuming you are using this java.awt.Dialog class

Upvotes: 1

Related Questions