Below snippet of code can be used to center a SWT shell on the screen
//center the dialog screen to the monitor
Monitor primary = display.getPrimaryMonitor ();
Rectangle bounds = primary.getBounds ();
Rectangle rect = shell.getBounds ();
int x = bounds.x + (bounds.width - rect.width) / 2;
int y = bounds.y + (bounds.height - rect.height) / 2;
shell.setLocation (x, y);
shell.open();
shell.layout();
Below link will provide a brief idea about creating a splash screen using SWT
http://www.eclipsezone.com/eclipse/forums/t53291.html
Wednesday, September 9, 2009
Subscribe to:
Post Comments (Atom)
Отличный код .. уважуха ...
ReplyDeleteТольк какjго хрена в самом SWT нет стандартных средств ?!?!?!?