How To Close the Shell [message #450384] |
Fri, 11 February 2005 11:01 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03258 seconds