1

I use JavaFx 8 WebEngine (custom browser) In my html page i have print button

document.querySelector('.check').onload = function() {
setTimeout(function() {
    window.print();
}, 500)

}

I want by clicking on the button print - catch this with your WebEngine

and send the document for printing.

The question is how to do this?

there is no such event in the documentation.

https://docs.oracle.com/javase/8/javafx/api/javafx/scene/web/WebEngine.html

window.alert()          onAlert
window.confirm()        confirmHandler
window.open()           createPopupHandler
window.open()           and
window.close()          onVisibilityChanged
window.prompt()         promptHandler
Setting window.status   onStatusChanged
Atum
  • 1,211
  • 1
  • 12
  • 14
  • Is this what you are trying to do? https://docs.oracle.com/javase/8/javafx/embedded-browser-tutorial/printing.htm – SedJ601 Dec 14 '17 at 14:53
  • button print in html page . – Atum Dec 14 '17 at 15:32
  • Did you look at the part titled `Processing JavaScript Commands`? https://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm\ – SedJ601 Dec 14 '17 at 15:34
  • the event is born in js - I want to catch it in java code. An alternative is to add an event from the java code to an element in the JS and DOM... i find only this https://stackoverflow.com/questions/29172001/javascript-function-listener-functionality-for-javafx/29177584#29177584 – Atum Dec 14 '17 at 15:51
  • Do [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) that shows what you have. Then explain what it is you are trying to do. – SedJ601 Dec 14 '17 at 15:54

0 Answers0