Package javafx.stage

Examples of javafx.stage.Stage


        // given:
        appSetup.setStageFuture(StageFuture.create());

        // when:
        appSetup.getStageFuture().set(null);
        Stage primaryStage = appSetup.getPrimaryStage(1, TimeUnit.SECONDS);

        // then:
        assertThat(primaryStage, Matchers.is(Matchers.nullValue()));
    }
View Full Code Here


    @Before
    public void setup() throws Throwable {
        stageSetup = new StageSetupImpl();
        FXTestUtils.invokeAndWait(() -> {
            primaryStage = new Stage();
            primaryStage.initStyle(StageStyle.UNDECORATED);
            primaryStage.setScene(new Scene(new Region(), 600, 400));
        }, 5);
    }
View Full Code Here

    public static void setupStagesClass() {
        Pane primarySceneRoot = new AnchorPane();
        primaryScene = new Scene(primarySceneRoot, 600, 400);

        primaryWindow = new Stage();
        primaryWindow.setX(100);
        primaryWindow.setY(100);
        primaryWindow.setScene(primaryScene);

        nodeInsideOfScene = new Rectangle(50, 50, 100, 100);
View Full Code Here

        Scene scene = new Scene((Parent) controller.getView(), 800, 600);
        primaryStage.setTitle("Fly app");
        primaryStage.setScene(scene);
        primaryStage.show();

        final Stage dialog = new Stage(StageStyle.TRANSPARENT);
        dialog.initModality(Modality.WINDOW_MODAL);
        dialog.initOwner(primaryStage);
        dialog.setScene(new Scene((Parent) SpringFXMLLoader.load("/fxml/login.fxml").getView()));
//        dialog.show();
    }
View Full Code Here

                                };
                            }
                        });
                        listView.getItems().setAll(fxForm.getConstraintViolations());
                        Scene scene = new Scene(listView);
                        Stage stage = new Stage();
                        stage.setScene(scene);
                        stage.show();
                    }
                }).build();
    }
View Full Code Here

public class GuiUtils {
    public static void runAlert(BiConsumer<Stage, AlertWindowController> setup) {
        // 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. I guess it makes sense in
        // an odd sort of way.
        Stage dialogStage = new Stage();
        dialogStage.initModality(Modality.APPLICATION_MODAL);
        FXMLLoader loader = new FXMLLoader(GuiUtils.class.getResource("alert.fxml"));
        Pane pane = evalUnchecked(() -> (Pane) loader.load());
        AlertWindowController controller = loader.getController();
        setup.accept(dialogStage, controller);
        dialogStage.setScene(new Scene(pane));
        dialogStage.showAndWait();
    }
View Full Code Here

                            Font.loadFont(getClass().getResource("Inconsolata.ttf").toExternalForm(), 12);
                            if (stage == null) {
                                tabPane = new TabPane();
                                Scene scene = new Scene(tabPane, 800, 600);
                                scene.getStylesheets().add(getClass().getResource("styles.css").toExternalForm());
                                stage = new Stage();
                                stage.setTitle("XMPP Viewer");
                                stage.getIcons().addAll(new Image(getClass().getResource("xmpp.png").toExternalForm()));
                                stage.setOnHidden(new EventHandler<WindowEvent>() {
                                    @Override
                                    public void handle(WindowEvent event) {
View Full Code Here

        stage.setX(0);
        stage.setY(0);
        stage.setTitle("AsciidocFX");
        stage.getIcons().add(new Image(getClass().getResourceAsStream("/public/favicon.ico")));

        Stage tableStage = new Stage();
        tableStage.setScene(new Scene(tableAnchor));
        tableStage.setTitle("Table Generator");
        tableStage.initModality(Modality.WINDOW_MODAL);
        tableStage.initOwner(scene.getWindow());

        controller.setStage(stage);
        controller.setScene(scene);
        controller.setTableAnchor(tableAnchor);
        controller.setTableStage(tableStage);
View Full Code Here

        public void handle(MouseEvent e) {
            if (currentResizeHandle.equals(handle.getCursor())) {
                double dX = e.getScreenX() - moveStartPoint.getX();
                double dY = e.getScreenY() - moveStartPoint.getY();
                Stage stage = getScene().getStage();
                if (currentResizeHandle == Cursor.W_RESIZE || currentResizeHandle == Cursor.NW_RESIZE || currentResizeHandle == Cursor.SW_RESIZE) {
                    if (setWindowWidth(startWidth - dX)) {
                        stage.setX(startX + dX);
                    }
                }
                if (currentResizeHandle == Cursor.N_RESIZE || currentResizeHandle == Cursor.NW_RESIZE || currentResizeHandle == Cursor.NE_RESIZE) {
                    if (setWindowHeight(startHeight - dY)) {
                        stage.setY(startY + dY);
                    }
                }
                if (currentResizeHandle == Cursor.E_RESIZE || currentResizeHandle == Cursor.SE_RESIZE || currentResizeHandle == Cursor.NE_RESIZE) {
                    setWindowWidth(startWidth + dX);
                }
View Full Code Here

            System.err.println("Error message: " + ex.getMessage());
        }
    }
   
    private void initDialog(Type t) {
        stage = new Stage();
        stage.initStyle(StageStyle.UTILITY);
       
        setType(t);
        stage.initModality(Modality.APPLICATION_MODAL);
        stage.setMaxWidth(Screen.getPrimary().getVisualBounds().getWidth() / 2);
View Full Code Here

TOP

Related Classes of javafx.stage.Stage

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.