|
Re: How to trigger the "Print" action of a Browser? [message #884313 is a reply to message #884274] |
Sun, 10 June 2012 19:33 |
|
Hello "Missing name Mising name" ,
yes it is possible...
I just created a sample application for you, so that you´re able to print my answer with it (browser.setUrl aims to this forum thread )
final Browser browser = new Browser(parent, SWT.NONE);
browser.setUrl("www.eclipse.org/forums/index.php/t/360700/");
Button button = new Button(parent, SWT.PUSH);
button.setText("Print");
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
boolean execute = browser.execute("window.print()");
if (execute) {
System.out.println("print dialog should appear.");
} else {
System.out.println("javascript could not be executed.");
}
}
});
Best regards,
Simon
|
|
|
|
Powered by
FUDForum. Page generated in 0.02513 seconds