Package javafx.fxml

Examples of javafx.fxml.FXMLLoader


     * Initializes the root layout.
     */
    public void initRootLayout() {
        try {
            // Load root layout from fxml file.
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(MainQuizCreator.class.getResource("view/RootLayout.fxml"));
            rootLayout = (BorderPane) loader.load();
            RootLayoutController rootController = loader.getController();
            rootController.setMainQuizCreator(this);
            // Show the scene containing the root layout.
            Scene scene = new Scene(rootLayout, WIDTH, HEIGHT);
            primaryStage.setScene(scene);
            primaryStage.show();
View Full Code Here


     * Shows the Quiz creator main menu inside the root layout.
     */
    public void showD2LQuizCreatorMain() {
        try {
            // Load person overview.
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(MainQuizCreator.class.getResource("view/D2LQuizCreatorMain.fxml"));
            AnchorPane D2LQuizCreatorMain = (AnchorPane) loader.load();
            D2LQuizCreatorMainController controller;
            controller = loader.getController();
            controller.setMainQuizCreator(this);
            // Set person overview into the center of root layout.
            rootLayout.setCenter(D2LQuizCreatorMain);
            primaryStage.setMaximized(false);
        } catch (IOException e) {
View Full Code Here

     * Opens New Quiz Options
     */
    public void showQuizOptions(Quiz quiz){
            try {
                // Load quiz options view.
                FXMLLoader loader = new FXMLLoader();
                loader.setLocation(MainQuizCreator.class.getResource("view/QuizOptionsScene.fxml"));
                AnchorPane QuizOptionsScene = (AnchorPane) loader.load();
                QuizOptionsController controller;
                controller = loader.getController();
                controller.setMainQuizCreator(this);
                if(quiz != null) {
                    //showing quiz private BorderPane rootLayout;
                    controller.setQuizName(QuizFactory.getQuizTitle(quiz));
                    controller.setFields(quiz);
View Full Code Here

            }
    }
   
    public void showAboutUsDialog(){
        try{
            FXMLLoader loader = new FXMLLoader(MainQuizCreator.class.getResource("view/AboutUsDialog.fxml"));
            AnchorPane page = (AnchorPane) loader.load();
            Stage dialogStage = new Stage();
            dialogStage.setTitle("About Us");
            dialogStage.initModality(Modality.WINDOW_MODAL);
            dialogStage.initOwner(primaryStage);
            Scene scene = new Scene(page);
            dialogStage.setScene(scene);
           
            AboutUsDialogController controller = loader.getController();
            controller.setDialogStage(dialogStage);
           
            dialogStage.showAndWait();
           
   
View Full Code Here

    }
   
    public void showQuizQuestionRoot(){
        try {
            // Load quiz options view.
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(MainQuizCreator.class.getResource("view/QuestionRootLayout.fxml"));
            questionRootLayout = (BorderPane) loader.load();
            QuestionRootLayoutController controller;
            controller = loader.getController();
            controller.setMainQuizCreator(this);
            primaryStage.setMaximized(true);
           
          
           
View Full Code Here

   
    //Load question tab pane
    public void loadQuestionTabPane(){
        try {
            // Load person overview.
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(MainQuizCreator.class.getResource("view/CreateQuestionsTabPage.fxml"));
            AnchorPane QuestionTabPane = (AnchorPane) loader.load();
            //D2LQuizCreatorMainController controller;
            //controller = loader.getController();
            //controller.setMainQuizCreator(this);
           
           
View Full Code Here

        return FXCollections.observableSet(new HashSet<>(list.build()));
    }

    private void setupFXML() {
        try {
            FXMLLoader loader = new FXMLLoader(getResource("controls/project_view.fxml"));
            loader.setRoot(this);
            loader.setController(this);
            // The following line is supposed to help Scene Builder, although it doesn't seem to be needed for me.
            loader.setClassLoader(getClass().getClassLoader());
            loader.load();

            goalAmountFormatStr = goalAmountLabel.getText();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
View Full Code Here

    protected SimpleObjectProperty<Address> address = new SimpleObjectProperty<>();
    private final StringExpression addressStr;

    public ClickableBitcoinAddress() {
        try {
            FXMLLoader loader = new FXMLLoader(getClass().getResource("bitcoin_address.fxml"));
            loader.setRoot(this);
            loader.setController(this);
            // The following line is supposed to help Scene Builder, although it doesn't seem to be needed for me.
            loader.setClassLoader(getClass().getClassLoader());
            loader.load();

            copyWidget.setCursor(Cursor.HAND);
            AwesomeDude.setIcon(copyWidget, AwesomeIcon.COPY);
            Tooltip.install(copyWidget, new Tooltip("Copy address to clipboard"));
View Full Code Here

    public ProjectOverviewWidget(Project project, LongProperty pledgedAmount,
                                 ObservableObjectValue<LighthouseBackend.ProjectState> state) {
        this.project = project;

        FXMLLoader loader = new FXMLLoader(GuiUtils.getResource("controls/project_overview_widget.fxml"));
        loader.setRoot(this);
        loader.setController(this);
        uncheck(loader::load);

        titleLabel.setText(project.getTitle());
        Text text = new Text(project.getMemo());
        blurbFlow.getChildren().setAll(text);
View Full Code Here

        try {
            // JavaFX doesn't actually have a standard alert template. Instead the Scene Builder app will create FXML
            // files for an alert window for you, and then you customise it as you see fit.
            Stage dialogStage = new Stage();
            dialogStage.initModality(Modality.APPLICATION_MODAL);
            FXMLLoader loader = new FXMLLoader(GuiUtils.class.getResource("alert.fxml"));
            Pane pane = loader.load();
            AlertWindowController controller = loader.getController();
            setup.accept(dialogStage, controller);
            dialogStage.setScene(new Scene(pane));
            dialogStage.showAndWait();
        } catch (Throwable e) {
            // We crashed whilst trying to show the alert dialog. This can happen if we're being crashed by inbound
View Full Code Here

TOP

Related Classes of javafx.fxml.FXMLLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.