2012-01-24 10 views
0
private Point getFirstMonitorSize() { // Here Point is org.eclipse.swt.graphics.Point 
    Display display = Display.getDefault(); 
    if (display != null) { 
     Monitor[] monitors = display.getMonitors(); 
     if (monitors.length == 1) { 
      Rectangle clientArea = monitors[0].getClientArea(); 
      return new Point(clientArea.width/2, clientArea.height/2); 
     } 
    } 
    return null; 
} 

私は位置決めのためにこれを見つけましたが、私はウィザードのダイアログでどのように使用するのか分かりません。私はウィザードを作成しました。私はそれを常に中央に配置したいのですが、誰でも助けてくれますか?

答えて

0

wizardDialog.getShell().setLocation(..)に電話すると、ウィザードのダイアログボックスを配置できます。

+0

ありがとうございます。これは動作します:) – pawarsantosh

+0

答えを受け入れることを忘れないでください... –

関連する問題