[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Shell location problem

I'm trying to show a dialog at a specific location with the following code. Notice that i'm making dialog visible when a mouse event is captured by a Swing component.

public void mouseClicked(MouseEvent e) {
[...]
else if ((e.getButton() == MouseEvent.BUTTON3) && (e.getClickCount() == 1)) { Display.getDefault().asyncExec(new Runnable () {
public void run() {
Shell shell = new Shell(SWT.ON_TOP);
shell.setLocation(50,50);
PlotRenderingDialog dialog = PlotRenderingDialog.getInstance(m_trace, new Shell(SWT.ON_TOP));
dialog.open();
}
});
}
[...]
}


The problem is that dialog appears in a random location, i mean, every time it appears it does in a different location.

If i use method setBounds(50, 50, width, height) it is positioned correctly but, i don't know the dialog size!

Any answers?