JavaFx 8: open a link in a browser without reference to Application
问题 Have got a Hyperlink. When clicked I want a link to be opened in an external browser. The usual method cited on the web seems to be: final Hyperlink hyperlink = new Hyperlink("http://www.google.com"); hyperlink.setOnAction(t -> { application.getHostServices().showDocument(hyperlink.getText()); }); However I don't have a reference to Application . The link is opened from Dialog, which is opened from a Controller, which is opened via an fxml file, so getting a reference to the Application