Skip to main content

IeEmbed.exe does not go away

5 replies [Last post]
Joined: 2008-02-04

I am using JDIC WebBrowser in a JDialog and the JDialog is launced from a JFrame.
I want to be able to pop the JDialog on some user input an then close it later. ( JFrame is the main window I want to keep active)
However, on closing the JDialog i see that the IeEmbed.exe is not terminated in the Task manager.

the IeEmbed.exe goes away only after i close the main Frame ( meaning, my jvm is also terminated)

Is there anything i have to do specifically ... like call any method of WebBrowser before i close the JDialog?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-04-20

Double check the Auto Dispose Parameter when creating the WebBrowser object.

boolean autodispose = false;
WebBrowser browser = new WebBrowser(autodispose);


Joined: 2008-02-04

I tried with both true and false values for AutoDispose - both don't work.

with AutoDispose = false - Nothing happens
with AutoDispose = true I get the following exception when the JDialog is disposed.

Exception in thread "Thread-5" java.lang.NullPointerException: null pData
at Method)
at java.awt.Component.removeNotify(
at org.jdesktop.jdic.browser.WebBrowser.access$201(Unknown Source)

Joined: 2008-02-04

I have now eliminated the exception, but the IeEmbed.exe still exists in task manager until I close the main JFrame window (System.exit(0)).

I instanstiated the WebBrowser with autodispose = false. and then explicity call dispose() before i dispose my JDialog. This elimiates the exception, but does not remove the IeEmbed.exe in the task manager.

I could not find a way to explicity trigger the WebBrowserEvent.WEBBROWSER_CLOSE either. Has anyone encountered my problem at all?

Joined: 2006-04-20

Yes, most of the time you want to keep ieembed around until the app shuts down.

So you should listen application frame shutdown events. However this needs to be done at the application level, you could have another window using an instance. For example you have a tabbedPane etc.

In my class that extends WebBrowser I do something like this.

public void onApplicationShutdown()
if (!this.isAutoDispose() && !this.isDisposed())
System.out("Not Shutting down the webbrowser");

Joined: 2008-02-04

OK, Sounds about right. ( I also see no exceptions in my debug window)

So in conclusion,
1) instantiate browser with autodispose = false in dialog
2) invoke browser.dispose explicitly before disposing the parent dialog.
browser.dispose() disposes the browser but the process ieembed.exe is not destroyed.
3) ieembed.exe is automatically removed when main application JFrame shuts down with System.exit(0).
4) There isn't an explicit way that the code can terminate iembed.exe without exiting.

Please do let me know if i got it right. I really appreciate all the help.