本文整理汇总了Java中javafx.stage.Stage.setMinWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Stage.setMinWidth方法的具体用法?Java Stage.setMinWidth怎么用?Java Stage.setMinWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.stage.Stage
的用法示例。
在下文中一共展示了Stage.setMinWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Atbash JWK Manager");
BorderPane root = new BorderPane();
Scene scene = new Scene(root, 600, 350, Color.WHITE);
primaryStage.setMinWidth(500);
primaryStage.setMinHeight(300);
new ApplicationMenu(primaryStage, root).initialize();
new HomeView(primaryStage, root).initialize();
new Footer(primaryStage, root).initialize();
root.prefHeightProperty().bind(scene.heightProperty());
root.prefWidthProperty().bind(scene.widthProperty());
primaryStage.setScene(scene);
primaryStage.show();
}
示例2: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
this.primaryStage = primaryStage;
Parent root = new AnchorPane();
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.getIcons().add(new Image(SQUID_LOGO_SANS_TEXT_URL));
primaryStage.setTitle("Squid 3.0 pre-release");
// this produces non-null window after .show()
primaryStageWindow = primaryStage.getScene().getWindow();
primaryStage.setOnCloseRequest((WindowEvent e) -> {
Platform.exit();
System.exit(0);
});
// postpone loading to allow for stage creation and use in controller
scene.setRoot(FXMLLoader.load(getClass().getResource("SquidUIController.fxml")));
primaryStage.show();
primaryStage.setMinHeight(scene.getHeight() + 15);
primaryStage.setMinWidth(scene.getWidth());
squidAboutWindow = new SquidAboutWindow(primaryStage);
}
示例3: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
FXMLLoader fxmlLoader = new FXMLLoader(
getClass().getResource("/FXML/main.fxml"));
Parent root = (Parent) fxmlLoader.load();
MainController mainController
= (MainController) fxmlLoader.getController();
DataModel model = new DataModel();
mainController.initModel(model);
mainController.setStage(stage);
Scene scene = new Scene(root);
scene.getStylesheets().add("/CSS/main.css");
stage.setTitle("Ember");
stage.getIcons().add(new Image(
"/images/EMBER-LOGO-COLOR.png"));
stage.setScene(scene);
stage.setMinHeight(550);
stage.setMinWidth(550);
stage.show();
stage.toFront();
}
示例4: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage aPrimaryStage) throws Exception {
FxMediaCatalog mediaCatalog = new FxMediaCatalog();
Scene scene = new Scene(mediaCatalog, mediaCatalog.getFormMinResolution().getWidth(), mediaCatalog.getFormMinResolution().getHeight());
aPrimaryStage.setTitle(FxMediaCatalogDemo.class.getSimpleName());
aPrimaryStage.setScene(scene);
aPrimaryStage.setMinWidth(mediaCatalog.getFormMinResolution().getWidth());
aPrimaryStage.setMinHeight(mediaCatalog.getFormMinResolution().getHeight());
aPrimaryStage.sizeToScene();
aPrimaryStage.centerOnScreen();
aPrimaryStage.show();
//
//mediaCatalog.getModel().onDeleteMedia().set(tagsItem -> { System.out.println("OnDeleteMedia: " + tagsItem); throw new RuntimeException("RE 123");});
mediaCatalog.getModel().setCatalogLocation(getCatalogLocation());
TreeItem<TagsItem> rootItem = mediaCatalog.getModel().getRootItem();
rootItem.setValue(new TagsItem("ABC", "Media Item 1", "Media 1", "Description AAA"));
TreeItem<TagsItem> childItem = new TreeItem<TagsItem>(new TagsItem("XYZ", "Media Item 2", "Media 2", "Description BBB"));
rootItem.getChildren().add(childItem);
childItem.getChildren().add(new TreeItem<TagsItem>(new TagsItem("MNL", "Media Item 3", "Media 3", "Description CCC")));
//
System.out.println("Catalog location: " + mediaCatalog.getModel().getCatalogLocation());
}
示例5: start
import javafx.stage.Stage; //导入方法依赖的package包/类
public void start(Stage stg) throws IOException {
guiroot = loader.load();
sc = new Scene(guiroot);
contr = loader.getController();
stg.setScene(sc);
stg.sizeToScene();
stg.setTitle("Plasmoxy - SentientLight/TrackMate");
stg.setMinHeight(stg.getHeight());
stg.setMinWidth(stg.getWidth());
stg.show();
stg.setOnCloseRequest(event ->
{
System.out.println("CLOSING");
contr.close();
});
contr.init();
}
示例6: 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 ) );
}
示例7: display
import javafx.stage.Stage; //导入方法依赖的package包/类
public static void display(String title, String message) {
Stage window = new Stage();
window.initModality(Modality.APPLICATION_MODAL);
window.setTitle(title);
window.setMinWidth(250);
Label label = new Label();
label.setText(message);
Button closeButton = new Button("Close the window");
closeButton.setOnAction(e -> window.close());
VBox layout = new VBox(10);
layout.getChildren().addAll(label, closeButton);
layout.setAlignment(Pos.CENTER);
Scene scene = new Scene(layout);
window.setScene(scene);
window.setResizable(false);
window.showAndWait();
}
示例8: openHelpText
import javafx.stage.Stage; //导入方法依赖的package包/类
/**
* @param url the url of the website to be shown
*/
public static void openHelpText(String title, String url) {
WebView wv = new WebView();
wv.getEngine().setJavaScriptEnabled(false);
wv.getEngine().load(url);
Scene pane = new Scene(wv);
Stage state = new Stage();
state.setScene(pane);
// pane.getButtonTypes().add(ButtonType.CLOSE);
state.setAlwaysOnTop(true);
state.setTitle(title);
state.setResizable(true);
state.setOpacity(0.8);
state.setMinHeight(250);
state.setMinWidth(250);
state.show();
}
示例9: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/ph/kana/memory/ui/fxml/main-form.fxml"));
Scene scene = new Scene(loader.load());
setUserAgentStylesheet(STYLESHEET_MODENA);
stage.setWidth(APP_WIDTH);
stage.setMinWidth(APP_WIDTH);
stage.setHeight(APP_HEIGHT);
stage.setMinHeight(APP_HEIGHT);
stage.setTitle("kana0011/password-locker");
stage.setScene(scene);
MainFormController controller = loader.<MainFormController>getController();
controller.setHostServices(getHostServices());
stage.show();
}
示例10: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception{
window = primaryStage;
//Create the normal window
Parent root = FXMLLoader.load(getClass().getResource("view_controller/Overview.fxml"));
primaryStage.setTitle("New Document - Luna Exam Builder");
primaryStage.setScene(new Scene(root, 1000, 625));
primaryStage.setMinWidth(MIN_WIDTH);
primaryStage.setMinHeight(MIN_HEIGHT);
//Set the icon
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("resources/icon.png")));
//Show
primaryStage.show();
}
示例11: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root, 800, 600));
primaryStage.setMinHeight(600);
primaryStage.setMinWidth(800);
primaryStage.setTitle("Zagadnienie transportowo-produkcyjne");
primaryStage.show();
}
示例12: start
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) {
WeekView root1 = new WeekView(LocalDate.now(), new Calendar());
Stage stage = new Stage();
stage.setScene(new Scene(root1));
stage.setTitle("Fastis");
stage.setMinWidth(100);
stage.setMinHeight(100);
stage.show();
testLayout(root1);
testCalendar(root1);
}
示例13: setDimensions
import javafx.stage.Stage; //导入方法依赖的package包/类
private static void setDimensions(Stage primaryStage) {
primaryStage.setMinWidth(primaryStage.getWidth());
primaryStage.setMinHeight(primaryStage.getHeight());
primaryStage.setWidth(800);
primaryStage.setHeight(600);
}
示例14: start
import javafx.stage.Stage; //导入方法依赖的package包/类
public void start(Stage stg) throws IOException
{
guiroot = loader.load();
sc = new Scene(guiroot);
contr = loader.getController();
stg.setScene(sc);
stg.sizeToScene();
stg.setTitle("Plasmoxy - CVFXBase");
stg.setOnCloseRequest( event ->
{
System.out.println("[App] Received close signal, calling close on controller");
contr.close();
});
contr.init(); // tell the controller to initialize itself now
stg.show(); // render the stage
// after rendering, fix the min size of it
stg.setMinHeight(stg.getHeight());
stg.setMinWidth(stg.getWidth());
System.out.println("[App] App launched");
}
示例15: showOptionsMenu
import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void showOptionsMenu()
{
List<Submittable> submittables = new ArrayList<>();
Map<OptionSection, Pane> optionsMenuModel = createOptionsMenuModel(submittables);
OptionsPane optionsPane = new OptionsPane(optionsMenuModel);
Scene popupScene = new Scene(optionsPane);
Stage popupWindow = new Stage(StageStyle.DECORATED);
popupWindow.setTitle("Settings");
popupWindow.initModality(Modality.WINDOW_MODAL);
popupWindow.initOwner(stage);
popupWindow.setScene(popupScene);
popupWindow.setMinWidth(stage.getScene().getWidth() / 2);
popupWindow.setMinHeight(stage.getScene().getHeight()
- (stage.getScene().getHeight() / 3));
popupScene.getStylesheets().addAll(stage.getScene().getStylesheets());
optionsPane.setOkAction(() -> {
if (optionsMenuOkSelected(submittables))
{
submittables.forEach(submittable -> submittable.submit());
popupWindow.close();
}
});
optionsPane.setCancelAction(() -> {
popupWindow.close();
});
popupWindow.setOnCloseRequest((windowEvent) -> {
popupWindow.close();
});
popupWindow.show();
}