Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How To Close the Shell
How To Close the Shell [message #450384] Fri, 11 February 2005 11:01 Go to next message
Eclipse UserFriend
Originally posted by: unwanted_210.yahoo.com

Hi All,
Im trying to embed my application base in Swing. Im currently using
SWT_AWT class to launch my wizards.

My code snippet...

Frame frame = SWT_AWT.new_Frame(composite);
Panel panel = new Panel(new BorderLayout()) {
public void update(java.awt.Graphics g) {
/* Do not erase the background */
paint(g);
}
};

frame.add(panel);

panel.add( myContentPane );

while(!shell.isDisposed()) {
if (!shell.getDisplay().readAndDispatch())
shell.getDisplay().sleep();
}
shell.dispose();

In myContentPane, there is a button that suppose to close the panel,
upon pressing, im issuing a dispose() method to invalidate my swing
components. Problem is, the window is still there, it won't close!

Can anybody help me on this?

Thanks in advance,
ajing
Re: How To Close the Shell [message #450385 is a reply to message #450384] Fri, 11 February 2005 11:07 Go to previous message
Eclipse UserFriend
Originally posted by: unwanted_210.yahoo.com

My apologies, i also have a shell.open(); call before
the while loop..

Thanks in advance,
Ajing

EclipseNewComer wrote:

> Hi All,
> Im trying to embed my application base in Swing. Im currently using
> SWT_AWT class to launch my wizards.

> My code snippet...

> Frame frame = SWT_AWT.new_Frame(composite);
> Panel panel = new Panel(new BorderLayout()) {
> public void update(java.awt.Graphics g) {
> /* Do not erase the background */
> paint(g);
> }
> };

> frame.add(panel);

> panel.add( myContentPane );

> while(!shell.isDisposed()) {
> if (!shell.getDisplay().readAndDispatch())
> shell.getDisplay().sleep();
> }
> shell.dispose();

> In myContentPane, there is a button that suppose to close the panel,
> upon pressing, im issuing a dispose() method to invalidate my swing
> components. Problem is, the window is still there, it won't close!

> Can anybody help me on this?

> Thanks in advance,
> ajing
Previous Topic:set combobox uneditable?
Next Topic:Very Efficient Tree Implementation
Goto Forum:
  


Current Time: Fri Apr 26 19:30:13 GMT 2024

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

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

Back to the top