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


Java Stage.sizeToScene方法代码示例

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


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

示例1: 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::ThunderLord/VisionGama");
    stg.setMinHeight(stg.getHeight());
    stg.setMinWidth(stg.getWidth());
    stg.show();
    
    stg.setOnCloseRequest( event ->
    {
        System.out.println("CLOSING");
        contr.close();
    });
    
}
 
开发者ID:Plasmoxy,项目名称:AquamarineLake,代码行数:22,代码来源:App.java

示例2: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage s) throws IOException, InterruptedException
{ 
    root = FXMLLoader.load(getClass().getResource("gui.fxml"));
    guisc = new Scene(root, 600, 400);
    s.setScene(guisc);
    s.setTitle("Plasmoxy::ThunderLord/DafuqFX");
    s.setResizable(false);
    s.sizeToScene();
    s.show();

    JFXButton blyat = (JFXButton) guisc.lookup("#blyat");
    blyat.setText("ASDASDASDASDASDASD");
    
    main.init(this, guisc);
    main.go();
    
}
 
开发者ID:Plasmoxy,项目名称:AquamarineLake,代码行数:19,代码来源:App.java

示例3: 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("");
    stg.setMinHeight(stg.getHeight());
    stg.setMinWidth(stg.getWidth());
    stg.show();
    
    stg.setOnCloseRequest( event ->
    {
        System.out.println("CLOSING");
        contr.close();
    });
    
}
 
开发者ID:ShardBytes,项目名称:Snipe,代码行数:22,代码来源:App.java

示例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());
}
 
开发者ID:mikelaud,项目名称:fx-media-catalog,代码行数:24,代码来源:FxMediaCatalogDemo.java

示例5: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
	App.stage = stage;
	try {
		Parent root = FXMLLoader.load(App.class.getResource("/ui/Main.fxml"));
		Scene scene = new Scene(root);
		scene.getStylesheets().add(getClass().getResource("/style.css").toExternalForm());
		stage.setTitle("OSRS Data To 317 Converter");		
		stage.centerOnScreen();
		stage.setResizable(false);
		stage.sizeToScene();
		stage.initStyle(StageStyle.UNDECORATED);
		stage.setScene(scene);	
		stage.getIcons().add(new Image(App.class.getResourceAsStream("/icons/icon.png")));
		stage.show();
	} catch(Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:nshusa,项目名称:osrs-data-converter,代码行数:20,代码来源:App.java

示例6: setUpPluginsStage

import javafx.stage.Stage; //导入方法依赖的package包/类
private void setUpPluginsStage() {
  pluginStage = new Stage();
  pluginStage.initModality(Modality.WINDOW_MODAL);
  pluginStage.addEventHandler(KeyEvent.KEY_PRESSED, e -> {
    if (e.getCode() == KeyCode.ESCAPE) {
      pluginStage.close();
    }
  });
  pluginStage.setScene(new Scene(pluginPane));
  pluginStage.sizeToScene();
  pluginStage.setMinWidth(675);
  pluginStage.setMinHeight(325);
  pluginStage.setTitle("Loaded Plugins");
  EasyBind.listBind(pluginPane.getStylesheets(), root.getStylesheets());
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:16,代码来源:MainWindowController.java

示例7: 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, 600, 400));
    primaryStage.setResizable(false);
    primaryStage.sizeToScene();
    primaryStage.show();
}
 
开发者ID:Plasmoxy,项目名称:AquamarineLake,代码行数:10,代码来源:Main.java

示例8: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage s) throws IOException
{

    loader = new FXMLLoader(getClass().getResource("gui.fxml"));
    root = loader.load();
    contr = loader.getController();
    contr.link(this);
    st = s;
    
    sc = new Scene(root);
    
    s.setScene(sc);
    s.setTitle("Plasmoxy::ThunderLord - VisionAlpha | by Sebo Petrík");
    s.setResizable(true);
    s.sizeToScene();
    s.show();
    s.setMinHeight(s.getHeight());
    s.setMinWidth(s.getWidth());

    s.setOnCloseRequest((new EventHandler<WindowEvent>() {
        public void handle(WindowEvent we)
        {
            System.out.println("CLOSING");
            contr.setClosed();
        }
    }));
    
}
 
开发者ID:Plasmoxy,项目名称:AquamarineLake,代码行数:30,代码来源:App.java

示例9: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
    stage.setTitle("QuizOff");
    stage.setOnCloseRequest(event -> logout());
    stage.setScene(new LoginScreen(stage, 640, 720));
    stage.setResizable(false);
    stage.sizeToScene();
    stage.show();
}
 
开发者ID:markrzyszkowski,项目名称:QuizOff,代码行数:10,代码来源:Client.java

示例10: createAndShowTableWindow

import javafx.stage.Stage; //导入方法依赖的package包/类
private void createAndShowTableWindow(ComboBox<String> traceNameComboBox) {
	openedWindowsCtr++;
	List<String> traceNames = new ArrayList<>();
	for (int i = 0; i < plotData.getAllTraces().size(); i++) {
		traceNames.add(plotData.getAllTraces().get(i).getTraceName());
	}
	traceNameComboBox.setItems(FXCollections.observableList(traceNames));
	traceNameComboBox.getSelectionModel().select(0);

	HBox hbox = new HBox();

	traceNameComboBox.getSelectionModel().select(0);
	Region spacer = new Region();
	HBox.setHgrow(spacer, Priority.ALWAYS);
	hbox.getChildren().addAll(new Label("Please Select a trace :"), spacer, traceNameComboBox);

	updateTableValues(traceNameComboBox);

	Scene scene = new Scene(new Group());
	VBox vbox = new VBox();
	VBox.setVgrow(table, Priority.ALWAYS);
	vbox.setSpacing(5);
	vbox.setPadding(new Insets(10, 10, 10, 10));
	vbox.prefWidthProperty().bind(scene.widthProperty());
	vbox.prefHeightProperty().bind(scene.heightProperty());
	vbox.getChildren().addAll(hbox, table);

	((Group) scene.getRoot()).getChildren().addAll(vbox);

	Stage stage = new Stage();
	stage.setOnCloseRequest(e -> closeTableWindow());
	stage.setWidth(300);
	stage.setHeight(400);
	stage.setScene(scene);
	stage.sizeToScene();
	stage.showAndWait();
}
 
开发者ID:jasrodis,项目名称:javafx-dataviewer,代码行数:38,代码来源:TopMenu.java

示例11: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
	Parent root = FXMLLoader.load(Main.class.getResource("MainPanel.fxml"));
	Scene scene = new Scene(root);
	primaryStage.setScene(scene);

	primaryStage.getIcons().add(new Image(Main.class.getResourceAsStream("/icon.png")));
	primaryStage.sizeToScene();
	primaryStage.setResizable(false);
	primaryStage.setTitle("TLD Mod Loader Installer");
	primaryStage.show();
}
 
开发者ID:zeobviouslyfakeacc,项目名称:ModLoaderInstaller,代码行数:13,代码来源:Main.java

示例12: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override public void start(Stage primaryStage) throws Exception {
    primaryStage.setTitle("Combo Box TreeView");
    primaryStage.setScene(new Scene(new ComboBoxTreeViewSample()));
    primaryStage.sizeToScene();
    primaryStage.show();

}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:8,代码来源:ComboBoxTreeViewApp.java

示例13: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override public void start(Stage primaryStage) {
    primaryStage.setTitle("TreeTable View Sample");
    primaryStage.setScene(new Scene(new ChoiceBoxTreeTableSample()));
    primaryStage.sizeToScene();
    primaryStage.show();
    TreeTableView<?> treeTableView = (TreeTableView<?>) primaryStage.getScene().getRoot().lookup(".tree-table-view");
    treeTableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:9,代码来源:ChoiceBoxTreeTableSampleApp.java

示例14: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override public void start(Stage primaryStage) throws Exception {
    primaryStage.setTitle("Choice Box TableView");
    primaryStage.setScene(new Scene(new ChoiceBoxTableViewSample()));
    primaryStage.sizeToScene();
    primaryStage.show();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:7,代码来源:ChoiceBoxTableViewApp.java

示例15: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override public void start(Stage primaryStage) throws Exception {
    primaryStage.setTitle("ListViewTextField");
    primaryStage.setScene(new Scene(new TextFieldListViewSample()));
    primaryStage.sizeToScene();
    primaryStage.show();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:7,代码来源:TextFieldListViewSampleApp.java


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