当前位置: 首页>>代码示例>>Java>>正文


Java Stage.setHeight方法代码示例

本文整理汇总了Java中javafx.stage.Stage.setHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Stage.setHeight方法的具体用法?Java Stage.setHeight怎么用?Java Stage.setHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.stage.Stage的用法示例。


在下文中一共展示了Stage.setHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    scene.setFill(Color.ALICEBLUE);
    stage.setScene(scene);
    stage.show();

    stage.setTitle("ChoiceBox Sample");
    stage.setWidth(300);
    stage.setHeight(200);
  
    label.setFont(Font.font("Arial", 25));
    label.setLayoutX(40);

   final String[] greetings = new String[]{"Hello", "Hola", "Привет", "你好",
       "こんにちは"};
   final ChoiceBox cb = new ChoiceBox(FXCollections.observableArrayList(
       "English", "Español", "Русский", "简体中文", "日本語")
   );
                                 
   cb.getSelectionModel().selectedIndexProperty().addListener(
       (ObservableValue<? extends Number> ov,
            Number old_val, Number new_val) -> {
                label.setText(greetings[new_val.intValue()]);            
    });
         
    cb.setTooltip(new Tooltip("Select the language"));
    cb.setValue("English");
    HBox hb = new HBox();
    hb.getChildren().addAll(cb, label);
    hb.setSpacing(30);
    hb.setAlignment(Pos.CENTER);
    hb.setPadding(new Insets(10, 0, 0, 10));

    ((Group) scene.getRoot()).getChildren().add(hb);
    
   
   
    
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:41,代码来源:ChoiceBoxSample.java

示例2: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Europian Country Population");
    stage.setWidth(500);
    stage.setHeight(500);
 
    ObservableList<PieChart.Data> pieChartData =
            FXCollections.observableArrayList(
            new PieChart.Data("Belgium", 3),
            new PieChart.Data("France", 26),
            new PieChart.Data("Germany", 35),
            new PieChart.Data("Netherlands", 7),
            new PieChart.Data("Sweden", 4),
            new PieChart.Data("United Kingdom", 25));
    final PieChart pieChart = new PieChart(pieChartData);
    pieChart.setTitle("Country Population");

    ((Group) scene.getRoot()).getChildren().add(pieChart);
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:PacktPublishing,项目名称:Java-for-Data-Science,代码行数:23,代码来源:PieChart - MainApp.java

示例3: start

import javafx.stage.Stage; //导入方法依赖的package包/类
public void start() {
    stage = new Stage();
    stage.initModality(Modality.APPLICATION_MODAL);
    stage.setTitle("New Project");
    stage.setWidth(500);
    stage.setHeight(200);
    stage.setResizable(false);

    Screen screen = new Screen();
    Point point = screen.calculateCenter(500, 200);
    stage.setX(point.getX());
    stage.setY(point.getY());

    CustomIcons customIcons = new CustomIcons();
    stage.getIcons().add(customIcons.getLogo());

    CreateProjectView createProjectView = new CreateProjectView();
    Scene scene = new Scene(createProjectView.getView());
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:MrChebik,项目名称:Coconut-IDE,代码行数:22,代码来源:CreateProjectPlace.java

示例4: start

import javafx.stage.Stage; //导入方法依赖的package包/类
public void start() {
    stage = new Stage();
    stage.initModality(Modality.APPLICATION_MODAL);
    stage.setTitle("Create Folder");
    stage.setWidth(400);
    stage.setHeight(150);
    stage.setResizable(false);

    Screen screen = new Screen();
    Point point = screen.calculateCenter(400, 150);
    stage.setX(point.getX());
    stage.setY(point.getY());

    CustomIcons customIcons = new CustomIcons();
    stage.getIcons().add(customIcons.getLogo());

    CreateFolderView createFolderView = new CreateFolderView();
    Scene scene = new Scene(createFolderView.getView());
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:MrChebik,项目名称:Coconut-IDE,代码行数:22,代码来源:CreateFolderPlace.java

示例5: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
    ComboBox<String> cmb = new JFXComboBox<>();
    new FilteredComboBoxDecorator<>(cmb, FilteredComboBoxDecorator.STARTSWITH_IGNORE_SPACES);
    cmb.setItems(FXCollections.observableArrayList(LISTA));
    Initializer.getToolBox()
            .getServices()
            .getConceptService()
            .findAllNames()
            .thenAccept(names -> {
               Platform.runLater(() -> cmb.setItems(FXCollections.observableArrayList(names)));
            });
    Scene scene = new Scene(new StackPane(cmb));
    scene.getStylesheets().addAll(Initializer.getToolBox().getStylesheets());
    stage.setScene(scene);
    stage.show();
    stage.setTitle("Filtered ComboBox");
    stage.setWidth(300);
    stage.setHeight(300);
}
 
开发者ID:mbari-media-management,项目名称:vars-annotation,代码行数:21,代码来源:FilteredComboBoxDecoratorDemo.java

示例6: scrollToRow

import javafx.stage.Stage; //导入方法依赖的package包/类
@Test public void scrollToRow() throws Throwable {
    Stage primaryStage = getPrimaryStage();
    primaryStage.setWidth(250);
    primaryStage.setHeight(250);
    TableView<?> tableViewNode = (TableView<?>) primaryStage.getScene().getRoot().lookup(".table-view");
    Platform.runLater(() -> {
        tableView.marathon_select("{\"rows\":[10]}");
    });
    new Wait("Wating for rows to be select.") {
        @Override public boolean until() {
            return tableViewNode.getSelectionModel().getSelectedIndex() == 10;
        }
    };
    new Wait("Waiting for the point to be in viewport") {
        @Override public boolean until() {
            Point2D point = getPoint(tableViewNode, 1, 10);
            return tableViewNode.getBoundsInLocal().contains(point);
        }
    };
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:21,代码来源:JavaFXTableViewElementScrollTest.java

示例7: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
    final Injector injector = Guice.createInjector(new WizardModule());

    final URL fxml = WizardMain.class.getClassLoader().getResource("wizard-fxml/Wizard.fxml");

    if (fxml != null) {
        final Parent p = FXMLLoader.load(fxml,
                null,
                new JavaFXBuilderFactory(),
                injector::getInstance
        );

        final Scene scene = new Scene(p);

        primaryStage.setScene(scene);
        primaryStage.setWidth(800);
        primaryStage.setHeight(600);
        primaryStage.setTitle("Java gEneric DAta Integration (JedAI) Toolkit");

        primaryStage.show();
    }
}
 
开发者ID:scify,项目名称:jedai-ui,代码行数:24,代码来源:WizardMain.java

示例8: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override public void start(Stage stage) {
    Config.initialize();
    Group root = new Group();
    mainFrame = new MainFrame(root);
    stage.setTitle("Brick Breaker");
    stage.setResizable(false);
    stage.setWidth(Config.SCREEN_WIDTH + 2*Config.WINDOW_BORDER);
    stage.setHeight(Config.SCREEN_HEIGHT+ 2*Config.WINDOW_BORDER + Config.TITLE_BAR_HEIGHT);
    Scene scene = new Scene(root);
    scene.setFill(Color.BLACK);
    stage.setScene(scene);
    mainFrame.changeState(MainFrame.SPLASH);
    stage.show();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:15,代码来源:Main.java

示例9: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start( final Stage primaryStage ) throws Exception {
    _primaryStage = primaryStage;

    primaryStage.setTitle( "Wall-T - Teamcity Radiator" );
    primaryStage.getIcons( ).addAll( UIUtils.createImage( "icons/icon.png" ) );

    primaryStage.setMinWidth( MIN_WIDTH );
    primaryStage.setMinHeight( MIN_HEIGHT );
    primaryStage.setWidth( MIN_WIDTH );
    primaryStage.setHeight( MIN_HEIGHT );

    _apiMonitoringService.start( );

    primaryStage.show( );

    _eventBus.post( new SceneEvent( ConfigurationScene.class ) );
}
 
开发者ID:u2032,项目名称:wall-t,代码行数:19,代码来源:WallApplication.java

示例10: start

import javafx.stage.Stage; //导入方法依赖的package包/类
public void start() {
    stage = new Stage();
    stage.initModality(Modality.APPLICATION_MODAL);
    stage.setTitle("Create File");
    stage.setWidth(400);
    stage.setHeight(150);
    stage.setResizable(false);

    Screen screen = new Screen();
    Point point = screen.calculateCenter(400, 150);
    stage.setX(point.getX());
    stage.setY(point.getY());

    CustomIcons customIcons = new CustomIcons();
    stage.getIcons().add(customIcons.getLogo());

    CreateFileView createFileView = new CreateFileView();
    Scene scene = new Scene(createFileView.getView());
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:MrChebik,项目名称:Coconut-IDE,代码行数:22,代码来源:CreateFilePlace.java

示例11: start

import javafx.stage.Stage; //导入方法依赖的package包/类
/**
 * Adds a chart viewer to the stage and displays it.
 * 
 * @param stage  the stage.
 * @throws Exception if something goes wrong.
 */
@Override
public void start(Stage stage) throws Exception {
    stage.setScene(new Scene(new MyDemoPane())); 
    stage.setTitle("JFreeChart: CrosshairOverlayFXDemo1.java"); 
    stage.setWidth(700);
    stage.setHeight(390);
    stage.show(); 
}
 
开发者ID:jfree,项目名称:jfree-fxdemos,代码行数:15,代码来源:CrosshairOverlayFXDemo1.java

示例12: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override 
public void start(Stage stage) throws Exception {
    PieDataset dataset = createDataset();
    JFreeChart chart = createChart(dataset); 
    ChartViewer viewer = new ChartViewer(chart);  
    stage.setScene(new Scene(viewer)); 
    stage.setTitle("JFreeChart: PieChartFXDemo1.java"); 
    stage.setWidth(700);
    stage.setHeight(390);
    stage.show(); 
}
 
开发者ID:jfree,项目名称:jfree-fxdemos,代码行数:12,代码来源:PieChartFXDemo1.java

示例13: start

import javafx.stage.Stage; //导入方法依赖的package包/类
/**
 * Adds a chart viewer to the stage and displays it.
 * 
 * @param stage  the stage.
 * @throws Exception if something goes wrong.
 */
@Override 
public void start(Stage stage) throws Exception {
    CategoryDataset dataset = createDataset();
    JFreeChart chart = createChart(dataset); 
    ChartViewer viewer = new ChartViewer(chart);
    viewer.addChartMouseListener(this);
    stage.setScene(new Scene(viewer)); 
    stage.setTitle("JFreeChart: BarChartFXDemo1.java"); 
    stage.setWidth(700);
    stage.setHeight(390);
    stage.show(); 
}
 
开发者ID:jfree,项目名称:jfree-fxdemos,代码行数:19,代码来源:BarChartFXDemo1.java

示例14: launch

import javafx.stage.Stage; //导入方法依赖的package包/类
public static SecondScreen launch() {

        ObservableList<Screen> screens = Screen.getScreens();

        if (screens.size() < 2)
            return null;

        Screen screen1 = screens.get(0);
        Screen screen2 = screens.get(1);
        log.info("screen1.getBounds() = " + screen1.getBounds());
        log.info("screen2.getBounds() = " + screen2.getBounds());
        Stage stage2 = new Stage();
        stage2.setScene(new Scene(new Label("primary")));
        stage2.setX(screen2.getVisualBounds().getMinX());
        stage2.setY(screen2.getVisualBounds().getMinY());
        stage2.setWidth(screen1.getBounds().getWidth());
        stage2.setHeight(screen1.getBounds().getHeight());
        Group root = new Group();
        Scene scene = new Scene(root, screen1.getBounds().getWidth(), screen1.getBounds().getHeight(), Color.BLACK);

        makeLighting(root, screen2.getBounds());

        stage2.setScene(scene);

        stage2.show();

        SecondScreen sc = new SecondScreen();

        Configuration config = ConfigurationBuilder.createFromPropertiesResource().build();

        /*
         * if (config.eyetracker.equals("tobii")) Tobii.execProg(sc); else
         */
        if (config.isGazeMode())
            gazeListener = new EyeTribeGazeListener(sc);
        else
            gazeListener = new FuzzyGazeListener(sc);

        return sc;
    }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:41,代码来源:SecondScreen.java

示例15: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
    CustomControl customControl = new CustomControl();
    customControl.setText("Hello!");
    
    stage.setScene(new Scene(customControl));
    stage.setTitle("Custom Control");
    stage.setWidth(300);
    stage.setHeight(200);
    stage.show();
}
 
开发者ID:jmblixt3,项目名称:Clash-Royale,代码行数:12,代码来源:CustomControlExample.java


注:本文中的javafx.stage.Stage.setHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。