How to embed Internet Explorer object into a java form

I am using jbuilder 2005 how can I (Steps, tutorial, ...) embed Microsoft Internet Explorer into my form?
eugie17Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_eeCommented:
0
eugie17Author Commented:
is it possible to embed the IE to java frame?
so that the document javascript and dom can be active?
0
neuromouseCommented:
I used to do this using SWT. Google a little, and meanwhile, I'll check if I have this code anywhere.
0
neuromouseCommented:
here's the code. First you have to get SWT working for your JBuilder.
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.browser.Browser; 

public class SWTBrowser extends Composite { 
	private Browser browser = null; 

	/**
	 * This method initializes browser	
	 *
	 */
	private void createBrowser() {
		browser = new Browser(this, SWT.NONE);
	} 
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		/* Before this is run, be sure to set up the launch configuration (Arguments->VM Arguments)
		 * for the correct SWT library path in order to run with the SWT dlls. 
		 * The dlls are located in the SWT plugin jar.  
		 * For example, on Windows the Eclipse SWT 3.1 plugin jar is:
		 *       installation_directory\plugins\org.eclipse.swt.win32_3.1.0.jar
		 */
		Display display = Display.getDefault();
		Shell shell = new Shell(display);
		shell.setLayout(new FillLayout());
		shell.setSize(new Point(640, 480));
		SWTBrowser thisClass = new SWTBrowser(shell, SWT.NONE);
		shell.open(); 
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	} 
	public SWTBrowser(Composite parent, int style) {
		super(parent, style);
		initialize();
	} 
	private void initialize() {
		createBrowser();
		this.setLayout(new FillLayout());
		browser.setUrl(testURL); // put your URL here
		setSize(new Point(768, 576));
		
	}
	
	public void setURL(String url) {
		browser.setUrl(url);
	} 
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.