[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Re: Centering a Dialog on Screen
|
Try this instead:
[code]
int width = display.getClientArea().width;
int height = display.getClientArea().height;
shell.setLocation((width - shell.getSize().x) / 2, (height - shell.getSize().y) / 2);
[/code]
I've removed the compensation for platform specific left/top insets. Not sure why it didn't work properly for you. The above code should though.