HTML code getter using SWT Browser

venlysheefe

New Member
How I can get html-page code to String using SWT Broser? \[code\] Display display = new Display(); Shell shell = new Shell(display); shell.setSize(100, 100); Browser browser = new Browser(shell, SWT.NONE); browser.setBounds(5, 75, 100, 100); shell.open(); browser.setUrl("https://google.com"); String html = browser.getText(); //NOTHING! while (!shell.isDisposed()) { if (!display.readAndDispatch() && html == null) { display.sleep(); } } display.dispose(); Syste.out.println(html); ////NOTHING!\[/code\]So, how I can take html? And best way, when after html-code getting the display window will close?
 
Back
Top