Example usage for javafx.stage Stage setMinWidth

List of usage examples for javafx.stage Stage setMinWidth

Introduction

In this page you can find the example usage for javafx.stage Stage setMinWidth.

Prototype

public final void setMinWidth(double value) 

Source Link

Usage

From source file:com.jcwhatever.resourcepackermc.Main.java

@Override
public void start(Stage stage) throws Exception {
    stage.setMinWidth(600);
    stage.setMinWidth(400);//  w  ww .  j a  v a  2 s  . c  o m
    Parent root = FXMLLoader.load(getClass().getResource("/com/jcwhatever/resourcepackermc/gui/Main.fxml"));
    stage.setTitle("ResourcePackerMC 0.2 beta");
    stage.setScene(new Scene(root, 600, 400));
    stage.show();
}

From source file:gui.accessories.GraphPopup.java

private void initFX(JFXPanel fxPanel) {
    // This method is invoked on the JavaFX thread
    Stage window = new Stage();
    window.initModality(Modality.APPLICATION_MODAL);
    window.setTitle(labels.getString("PONTOS.VITORIA"));
    window.setMinWidth(500);

    Chart chart = createStackedBarChart();
    chart.setAnimated(true);/*from  w  w  w . j  a v  a 2 s . c om*/
    Scene scene = new Scene(chart);

    //show and tell
    window.setScene(scene);
    window.showAndWait();

    fxPanel.setScene(scene);
}

From source file:dbsdemo.RegistrationWindowController.java

public void goToMainWindowScene(User user) {
    // Load properties file - TODO catch exception
    Properties prop = PropLoader.load("etc/config.properties");
    // Continue to main window screen
    try {//www .  j  av  a2  s  .com
        FXMLLoader loader = new FXMLLoader(getClass().getResource(prop.getProperty("MainWindowPath")));
        Parent root = (Parent) loader.load();

        MainWindowController mainWindowController = loader.getController();
        mainWindowController.setActiveUser(user);

        //Scene scene = new Scene(root);
        Stage mainWindowStage = new Stage();
        mainWindowStage.setTitle("Fuel database");
        mainWindowStage.setMinHeight(mainWindowStage.getHeight());
        mainWindowStage.setMinWidth(mainWindowStage.getWidth());
        mainWindowStage.setScene(new Scene(root));

        mainWindowStage.show();
    } catch (IOException ex) {
        Logger.getLogger(LoginWindowController.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:pl.mcpg.nbtjeditor.Start.java

@Override
public void start(Stage stage) {
    Parent parent = null;//  ww  w.  ja v a  2s.  com
    FXMLLoader loader = new FXMLLoader();
    try {
        parent = loader.load(getClass().getResourceAsStream("/main.fxml"));
    } catch (Exception e) {
        displayError("Couldn't load main FXML file! Application will\nnow close.", e);
        e.printStackTrace();
        System.exit(1);
    }
    stage.setMinWidth(150);
    stage.setMinHeight(150);
    stage.setTitle(APP_TITLE);
    stage.setScene(new Scene(parent, 640, 480));
    ((MainController) loader.getController()).setStage(stage);
    stage.show();
    if (fileToOpen != null && fileToOpen.exists()) {
        ((MainController) loader.getController()).open(null);
    }
}

From source file:com.exalttech.trex.ui.UIBaseTest.java

@Override
public void start(Stage stage) throws Exception {
    TrexApp.setPrimaryStage(stage);/*  w  ww  . java 2s.  c  om*/
    AnchorPane page = (AnchorPane) FXMLLoader.load(getClass().getResource("/fxml/MainView.fxml"));
    Scene scene = new Scene(page);
    scene.getStylesheets().add(TrexApp.class.getResource("/styles/mainStyle.css").toExternalForm());
    stage.setScene(scene);
    stage.setTitle("TRex");
    stage.setResizable(true);
    stage.setMinWidth(1100);
    stage.setMinHeight(670);
    stage.show();
}

From source file:org.dataconservancy.packaging.gui.App.java

public void start(Stage stage) throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
            "classpath*:org/dataconservancy/config/applicationContext.xml",
            "classpath*:org/dataconservancy/packaging/tool/ser/config/applicationContext.xml",
            "classpath*:applicationContext.xml");

    // min supported size is 800x600
    stage.setMinWidth(800);
    stage.setMinHeight(550);/* w  w  w . j av a  2s  .  co  m*/
    Factory factory = (Factory) context.getBean("factory");
    factory.setStage(stage);

    Font.loadFont(App.class.getResource("/fonts/OpenSans-Regular.ttf").toExternalForm(), 14);
    Font.loadFont(App.class.getResource("/fonts/OpenSans-Italic.ttf").toExternalForm(), 14);
    Font.loadFont(App.class.getResource("/fonts/OpenSans-Bold.ttf").toExternalForm(), 14);

    Configuration config = factory.getConfiguration();
    CmdLineParser parser = new CmdLineParser(config);

    try {
        List<String> raw = getParameters().getRaw();
        parser.parseArgument(raw.toArray(new String[raw.size()]));
    } catch (CmdLineException e) {
        System.out.println(e.getMessage());
        log.error(e.getMessage());
        Platform.exit();
        return;
    }

    Controller controller = factory.getController();
    controller.setApplicationHostServices(getHostServices());

    controller.startApp();

    // Default size to 800x800, but shrink if screen is too small
    double sceneHeight = 800;

    Rectangle2D screen = Screen.getPrimary().getVisualBounds();
    if (screen.getHeight() < 800) {
        sceneHeight = screen.getHeight() - 50;
        if (sceneHeight < 550)
            sceneHeight = 550;
    }

    Scene scene = new Scene(controller.asParent(), 800, sceneHeight);
    scene.getStylesheets().add("/css/app.css");

    stage.getIcons().add(new Image("/images/DCPackageTool-icon.png"));
    stage.setTitle("DC Package Tool");
    stage.setScene(scene);
    stage.show();

}

From source file:com.ro.ssc.app.client.licensing.TrialKeyGenerator.java

@Override
public void start(Stage stage) throws Exception {

    log.info("Starting Litho InSight");
    this.stage = stage;

    log.debug("Loading FXML for main view from: {}", ROOT_LAYOUT_FILE);
    FXMLLoader loader = new FXMLLoader();

    Parent rootNode = (Parent) loader.load(getClass().getResourceAsStream(ROOT_LAYOUT_FILE));

    log.debug("Showing JFX scene");
    Scene scene = new Scene(rootNode, SCENE_MIN_WIDTH, SCENE_MIN_HEIGHT);
    // scene.getStylesheets().add(MAIN_CSS_FILE);

    stage.setTitle("Soft Pontaj v2.0");
    stage.setMinWidth(SCENE_MIN_WIDTH);
    stage.setMinHeight(SCENE_MIN_HEIGHT);
    stage.setScene(scene);/*from w  ww. j a  va  2  s.  c  o  m*/

    stage.show();
}

From source file:calendarioSeries.vistas.MainViewController.java

@FXML
private void addNewSerie() {
    Parent root;// www. ja va2 s . c o  m
    try {
        FXMLLoader loader = new FXMLLoader();
        loader.setLocation(MainViewController.class.getResource("NewSerieView.fxml"));
        root = loader.load();

        NewSerieController controller = loader.getController();
        controller.setMainController(this);

        Stage stage = new Stage();
        stage.setTitle("Aade una nueva serie");
        stage.setScene(new Scene(root));
        stage.setMinHeight(650);
        stage.setMinWidth(600);
        stage.setResizable(false);
        stage.show();
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:org.jamocha.gui.JamochaGui.java

@Override
public void start(final Stage primaryStage) {
    this.primaryStage = primaryStage;

    this.jamocha = new Jamocha();

    final Scene scene = generateScene();

    if (file == null) {
        final FileChooser fileChooser = new FileChooser();
        final ExtensionFilter filter = new ExtensionFilter("CLIPS files", "*.clips");
        fileChooser.getExtensionFilters().add(filter);
        fileChooser.getExtensionFilters().add(new ExtensionFilter("All files", "*.*"));
        file = fileChooser.showOpenDialog(primaryStage);
    }/*from  ww  w . j  a  va 2  s.c o m*/

    primaryStage.setMinWidth(800);
    primaryStage.setMinHeight(600);
    primaryStage.setTitle("Jamocha");
    primaryStage.setScene(scene);
    loadState(primaryStage);
    primaryStage.show();
    try (final PrintStream out = new PrintStream(new LogOutputStream(this.log))) {
        System.setOut(out);
        System.setErr(out);

        if (file != null) {
            System.out.println("Opening file: \"" + file.getName() + "\"");
            loadFile(file);
        } else {
            System.out.println("No file selected!");
        }
    }
}

From source file:view.EditorView.java

@Override
public void start(Stage primaryStage) throws Exception {
    Platform.setImplicitExit(true);//  w w  w.  j  a v  a  2  s . c  om
    bundle = ResourceBundle.getBundle("view.strings");
    stage = primaryStage;

    try {
        Parent root = FXMLLoader.load(getClass().getResource("EditorMain.fxml"), bundle);

        Scene scene = new Scene(root);
        scene.getStylesheets().add(getClass().getResource("EditorMain.css").toExternalForm());

        primaryStage.setMinWidth(scene.getRoot().minWidth(0) + 70);
        primaryStage.setMinHeight(scene.getRoot().minHeight(0) + 70);

        primaryStage.setScene(scene);

        // Set Icon
        primaryStage.getIcons().add(new Image(MainWindow.class.getResourceAsStream("icon.png")));

        primaryStage.show();
    } catch (Exception e) {
        FOKLogger.log(MainWindow.class.getName(), Level.SEVERE, "An error occurred", e);
    }
}