List of usage examples for javafx.scene Group Group
public Group(Collection<Node> children)
From source file:Main.java
@Override public void start(Stage stage) { Button openURLButton = new Button("Go!"); openURLButton.setOnAction(e -> {// w w w.j av a 2s .c o m HostServices host = getHostServices(); JSObject js = host.getWebContext(); if (js == null) { Stage s = new Stage(StageStyle.UTILITY); s.initModality(Modality.WINDOW_MODAL); Label msgLabel = new Label("This is an FX alert!"); Group root = new Group(msgLabel); Scene scene = new Scene(root); s.setScene(scene); s.setTitle("FX Alert"); s.show(); } else { js.eval("window.alert('This is a JavaScript alert!')"); } }); Scene scene = new Scene(openURLButton); stage.setScene(scene); stage.setTitle("Knowing the Host"); stage.show(); }