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