Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Close Window Button
Close Window Button [message #588880] Tue, 04 March 2008 02:04
Eclipse UserFriend
Originally posted by: unknown.domain.com

I have made a "close" button. My close button is supposed to close the
window and open another one. How can I do this? Here is my code:
btnExit.addSelectionListener(new SelectionAdapter() {
	public void widgetSelected(final SelectionEvent arg0)
	{
		doClose();
	}
});		
 
shell.addDisposeListener(new DisposeListener() {
	public void widgetDisposed(final DisposeEvent arg0) {
		doClose();
	}
});	


private void doClose() {
	shell.dispose();
	new MainWindow();
}


When I use the "X" button in the window's top-right corner, the window
closes properly and everything is good. However, when I close the window
using my Close button, the window does not close properly. I'm assuming
it's because I call new MainWindow() after shell.dispose(). But if I call
new MainWindow() before shell.dispose() my window will never close.

Any help?
Previous Topic:Close Window Button
Next Topic:Re: Need a multi-column list widget for SWT
Goto Forum:
  


Current Time: Sat Dec 20 16:37:49 GMT 2014

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

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