1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test;
import com.javafx.experiments.scenicview.ScenicView;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.AnchorPaneBuilder;
import javafx.stage.Stage;
/**
*
* @author Fabrice
*/
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
AnchorPane root = AnchorPaneBuilder.create().build();
Foo foo = (Foo) new FXMLLoader(getClass().getResource("Test.fxml")).load();
root.getChildren().add(foo);
Scene scene = new Scene(root, 500, 500);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
ScenicView.show(scene);
}
/**
* The main() method is ignored in correctly deployed JavaFX
* application. main() serves only as fallback in case the
* application can not be launched through deployment artifacts,
* e.g., in IDEs with limited FX support. NetBeans ignores main().
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
} |
Partager