本文整理汇总了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);
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
};
}
示例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();
}
}
示例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();
}
示例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 ) );
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}