How can I integrate swt browser into my SWING application?

ionutcib used Ask the Experts™
How can I integrate SWT browser into my SWING application?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

SWT itself is a GUI library like Swing. And SWT Browser is part of the SWT library. Unlike Swing, SWT is platform specific (ex; Windows).
So, why don't you use SWT for the your GUI development too?
I have given below a raw sample code using SWT only here. Hope this might be useful OR pardon me if you already knew this....

hope this helps!
public static void main(String [] args) { 
            Display display = new Display(); 
		//create a SWT window
            Shell shell = new Shell(display); 
		//create the browser 
            WebKitBrowser browser= new WebKitBrowser(shell, SWT.NONE); 
            browser.setUrl(<home page URL here>); 
            while (!shell.isDisposed()) { 					 
                if (!display.readAndDispatch())

Open in new window


I already have an application in swing and it will be difficult to translate all in swt now(or it will not?)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial