本文整理汇总了Java中javafx.stage.Stage.setMaxWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Stage.setMaxWidth方法的具体用法?Java Stage.setMaxWidth怎么用?Java Stage.setMaxWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.stage.Stage
的用法示例。
在下文中一共展示了Stage.setMaxWidth方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
FXMLLoader loader = new FXMLLoader(getClass().getClassLoader().getResource("view.fxml"));
GridPane gridPane = null;
try {
gridPane = loader.load();
} catch (IOException e) {
e.printStackTrace();
}
GeneratorController controller = loader.getController();
Scene scene = new Scene(gridPane, 900, 450);
stage.setTitle("Generator faktur Dtree");
stage.setScene(scene);
stage.setMaxHeight(842.0);
stage.setMaxWidth(1366.0);
stage.setResizable(true);
stage.show();
}
示例2: handleSaveGame
import javafx.stage.Stage; //导入方法依赖的package包/类
/**
* Opens a dialog to save the game
*/
@FXML
protected void handleSaveGame() {
try {
// Load game saving view
FXMLLoader loader = new FXMLLoader();
loader.setResources(this.scrabble.getI18nMessages());
loader.setLocation(Scrabble.class.getResource("view/SaveGame.fxml"));
VBox page = loader.load();
// Create the dialog stage
Stage dialogStage = new Stage();
dialogStage.setMinWidth(SaveGameController.STAGE_WIDTH);
dialogStage.setMaxWidth(SaveGameController.STAGE_WIDTH);
dialogStage.setMinHeight(SaveGameController.STAGE_HEIGHT);
dialogStage.setMaxHeight(SaveGameController.STAGE_HEIGHT);
dialogStage.setTitle(this.scrabble.getI18nMessages().getString("save"));
dialogStage.initModality(Modality.WINDOW_MODAL);
dialogStage.initOwner(this.scrabble.getPrimaryStage());
Scene scene = new Scene(page);
dialogStage.setScene(scene);
SaveGameController controller = loader.getController();
controller.setDialogStage(dialogStage);
controller.setScrabble(this.scrabble);
dialogStage.showAndWait();
} catch (IOException e) {
this.scrabble.showGeneralApplicationError(e);
}
}
示例3: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/main.fxml"));
Parent root = fxmlLoader.load();
primaryStage.setTitle("ソースリスト作るよ");
primaryStage.setScene(new Scene(root, 700, 500));
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/icons.png")));
primaryStage.setMinHeight(500);
primaryStage.setMinWidth(700);
Controller controller = fxmlLoader.getController();
controller.init(primaryStage);
primaryStage.setMaxHeight(500);
primaryStage.setMaxWidth(700);
primaryStage.show();
}
示例4: configureSize
import javafx.stage.Stage; //导入方法依赖的package包/类
/**
* Configure size of the root container.
*
* @param container the root container.
* @param size the size.
*/
@FXThread
private void configureSize(@NotNull final VBox container, @NotNull final Point size) {
final Stage dialog = getDialog();
final double width = size.getX();
final double height = size.getY();
if (width >= 1D) {
FXUtils.setFixedWidth(container, width);
dialog.setMinWidth(width);
dialog.setMaxWidth(width);
}
if (height >= 1D) {
FXUtils.setFixedHeight(container, height);
dialog.setMinHeight(height);
dialog.setMaxHeight(height);
}
}
示例5: initGraphics
import javafx.stage.Stage; //导入方法依赖的package包/类
protected void initGraphics(Stage stage) {
scene = new Scene(new Region());
scene.setFill(null);
stage.setMaxWidth(1);
stage.setMaxHeight(1);
stage.setWidth(1);
stage.setHeight(1);
stage.getIcons().add(new javafx.scene.image.Image("resources/Logo.png"));
stage.setResizable(false);
stage.setAlwaysOnTop(true);
}
示例6: handleExchangeLetterWithBag
import javafx.stage.Stage; //导入方法依赖的package包/类
/**
* Exchanges a letter with the bag
*/
@FXML
protected void handleExchangeLetterWithBag() {
try {
this.refreshScrabbleInterface();
// Load letters exchanging view
FXMLLoader loader = new FXMLLoader();
loader.setResources(this.scrabble.getI18nMessages());
loader.setLocation(Scrabble.class.getResource("view/ExchangeLetter.fxml"));
VBox page = loader.load();
// Create the dialog stage
Stage dialogStage = new Stage();
dialogStage.setMinWidth(ExchangeLettersController.EXCHANGE_LETTERS_STAGE_WIDTH);
dialogStage.setMaxWidth(ExchangeLettersController.EXCHANGE_LETTERS_STAGE_WIDTH);
dialogStage.setMinHeight(ExchangeLettersController.EXCHANGE_LETTERS_STAGE_HEIGHT);
dialogStage.setMaxHeight(ExchangeLettersController.EXCHANGE_LETTERS_STAGE_HEIGHT);
dialogStage.setTitle(this.scrabble.getI18nMessages().getString("exchangeLettersWithTheBag"));
dialogStage.initModality(Modality.WINDOW_MODAL);
dialogStage.initOwner(this.scrabble.getPrimaryStage());
Scene scene = new Scene(page);
dialogStage.setScene(scene);
ExchangeLettersController controller = loader.getController();
controller.setDialogStage(dialogStage);
controller.setScrabble(this.scrabble);
controller.initializeInterface();
dialogStage.showAndWait();
this.refreshLetters();
} catch (IOException e) {
this.scrabble.showGeneralApplicationError(e);
}
}