i looking way display html file in different stage once button clicked.
public void handlebuttonaction(actionevent event) throws ioexception { if (event.getsource() == help) { stage = (stage) help.getscene().getwindow(); root = fxmlloader.load(getclass().getresource("help.fxml")); webview browser = new webview(); scene helpscene = new scene(root); stage helpstage = new stage(); helpstage.settitle("help menu"); helpstage.setscene(helpscene); url url = getclass().getresource("readme.html"); browser.getengine().load(url.toexternalform()); helpstage.show(); } }
your code fine except forgot add webview scene, do
((pane) helpscene.getroot()).getchildren().add(browser);
Comments
Post a Comment