Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to centralize an SWT Dialog?
How to centralize an SWT Dialog? [message #299723] Wed, 22 February 2006 14:56 Go to next message
Eclipse UserFriend
Originally posted by: alexandregazola.yahoo.com.br

Hello,

Does anybody know how to centralize an SWT Dialog???

thanks
Re: How to centralize an SWT Dialog? [message #299725 is a reply to message #299723] Wed, 22 February 2006 17:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: csae7511.uibk.ac.at

Try this - the shell is the shell of the dialog.

Rectangle rec = shell.getDisplay().getClientArea();
Rectangle shellBounds = shell.getBounds();
shell.setLocation((rec.width - shellBounds.width) / 2, (rec.height -
shellBounds.height) / 2);


Regards,
Stefan

Alexandre Gazola schrieb:
> Hello,
>
> Does anybody know how to centralize an SWT Dialog???
>
> thanks
>
Re: How to centralize an SWT Dialog? [message #299735 is a reply to message #299725] Thu, 23 February 2006 06:32 Go to previous messageGo to next message
Eclipse UserFriend
Rectangle rect = getShell().getDisplay().getPrimaryMonitor().getBounds();

for us multi monitor types
Re: How to centralize an SWT Dialog? [message #299759 is a reply to message #299735] Thu, 23 February 2006 14:29 Go to previous message
Eclipse UserFriend
Originally posted by: csae7511.uibk.ac.at

Thanks - I didn't know about that :-)

Phill_Perryman@Mitel.COM schrieb:
> Rectangle rect = getShell().getDisplay().getPrimaryMonitor().getBounds();
>
> for us multi monitor types
Previous Topic:how to print a stack trace in an ExceptionDialog?
Next Topic:Getting ScrolledForm to recognize needed scrollsbars
Goto Forum:
  


Current Time: Tue Jul 22 15:29:46 EDT 2025

Powered by FUDForum. Page generated in 0.03353 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top