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


Java Stage.setX方法代码示例

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


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

示例1: start

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

  stage.initStyle(StageStyle.TRANSPARENT);

  VBox box = new VBox(20);
  box.setMaxWidth(Region.USE_PREF_SIZE);
  box.setMaxHeight(Region.USE_PREF_SIZE);
  box.setBackground(Background.EMPTY);
  String style = "-fx-background-color: rgba(255, 255, 255, 0.5);";
  box.setStyle(style);

  box.setPadding(new Insets(50));
  BorderPane root = new BorderPane(box);
  root.setStyle(style);
  root.setBackground(Background.EMPTY);
  Scene scene = new Scene(root);
  scene.setFill(Color.TRANSPARENT);
  stage.setScene(scene);

  ImageView splashView = new ImageView(splashImage);
  box.getChildren().addAll(splashView, new Label("ST Verification Studio is loading.."));
  stage.show();
  Rectangle2D primScreenBounds = Screen.getPrimary().getVisualBounds();
  stage.setX((primScreenBounds.getWidth() - stage.getWidth()) / 2);
  stage.setY((primScreenBounds.getHeight() - stage.getHeight()) / 2);
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:29,代码来源:StvsPreloader.java

示例2: start

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

	Point mousePosition = MouseInfo.getPointerInfo().getLocation();
	stage.setX(mousePosition.getX());
	stage.setY(mousePosition.getY());

	try {
		dataStorage = new DataStorage();
	} catch (IOException ex) {
		logger.error("Could not initialize working directory", ex);

		ExceptionDialog exceptionDialog = new ExceptionDialog(ex);
		exceptionDialog.setTitle("Error");
		exceptionDialog.setHeaderText("Could not initialize working directory");
		exceptionDialog.show();

		return;
	}

	new MainWindow(stage);

	stage.setMaximized(true);
}
 
开发者ID:Quantencomputer,项目名称:cyoastudio,代码行数:26,代码来源:Application.java

示例3: 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();
}
 
开发者ID:MrChebik,项目名称:Coconut-IDE,代码行数:22,代码来源:CreateFilePlace.java

示例4: clickItem

import javafx.stage.Stage; //导入方法依赖的package包/类
@FXML
public void clickItem(MouseEvent event) throws IOException
{
    if (event.getClickCount() == 2) {
        stage = (Stage) label.getScene().getWindow();
        FXMLLoader loader = new FXMLLoader(getClass().getResource("/callib/Views/BorrowedDetails.fxml"));
        Stage modal  = new Stage();
        modal.initModality(Modality.APPLICATION_MODAL);
        modal.setScene(
                new Scene((Pane) loader.load())
        );
        modal.setX(stage.getX() + 50);
        modal.setY(stage.getY() + 50);
        BorrowedDetailsController controller = (BorrowedDetailsController) loader.getController();
        controller.initData(table.getSelectionModel().getSelectedItem().getId());
        
        modal.showAndWait();
        this.displayData();
    }
}
 
开发者ID:bartoszgajda55,项目名称:IP1,代码行数:21,代码来源:BorrowedController.java

示例5: goToMakeATransaction

import javafx.stage.Stage; //导入方法依赖的package包/类
public void goToMakeATransaction(double positionX, double positionY) {
	try {
		Stage MakeATransactionStage = new Stage();
		Parent root = FXMLLoader.load(getClass().getResource("/view/MakeATransaction.fxml"));
		Scene scene = new Scene(root,800,550);
		MakeATransactionStage.setScene(scene);
		MakeATransactionStage.setResizable(false);
		MakeATransactionStage.getIcons().add(new Image(getClass().getResourceAsStream("/imges/purse.png")));
		MakeATransactionStage.setTitle("Make A Transaction");
		MakeATransactionStage.setX(positionX);
		MakeATransactionStage.setY(positionY);
		MakeATransactionStage.show();
	} catch(Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:krHasan,项目名称:Money-Manager,代码行数:17,代码来源:GoToOperation.java

示例6: goToSettings

import javafx.stage.Stage; //导入方法依赖的package包/类
public void goToSettings(double positionX, double positionY) {
	try {
		Stage SettingsStage = new Stage();
		Parent root = FXMLLoader.load(getClass().getResource("/view/Settings.fxml"));
		Scene scene = new Scene(root,800,550);
		SettingsStage.setScene(scene);
		SettingsStage.setResizable(false);
		SettingsStage.getIcons().add(new Image(getClass().getResourceAsStream("/imges/purse.png")));
		SettingsStage.setTitle("Settings");
		SettingsStage.setX(positionX);
		SettingsStage.setY(positionY);
		SettingsStage.show();
	} catch(Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:krHasan,项目名称:Money-Manager,代码行数:17,代码来源:GoToOperation.java

示例7: goToTransactionHistory

import javafx.stage.Stage; //导入方法依赖的package包/类
public void goToTransactionHistory(double positionX, double positionY) {
	try {
		Stage TransactionHistoryStage = new Stage();
		Parent root = FXMLLoader.load(getClass().getResource("/view/TransactionHistory.fxml"));
		Scene scene = new Scene(root,800,550);
		TransactionHistoryStage.setScene(scene);
		TransactionHistoryStage.setResizable(false);
		TransactionHistoryStage.getIcons().add(new Image(getClass().getResourceAsStream("/imges/purse.png")));
		TransactionHistoryStage.setTitle("Transaction History");
		TransactionHistoryStage.setX(positionX);
		TransactionHistoryStage.setY(positionY);
		TransactionHistoryStage.show();
	} catch(Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:krHasan,项目名称:Money-Manager,代码行数:17,代码来源:GoToOperation.java

示例8: clickItem

import javafx.stage.Stage; //导入方法依赖的package包/类
@FXML
private void clickItem(MouseEvent event) throws IOException {
    if (event.getClickCount() == 2) {
        stage = (Stage) label.getScene().getWindow();
        FXMLLoader loader = new FXMLLoader(getClass().getResource("/callib/Views/SearchDetails.fxml"));
        Stage modal  = new Stage();
        modal.initModality(Modality.APPLICATION_MODAL);
        modal.setScene(
                new Scene((Pane) loader.load())
        );
        modal.setX(stage.getX() + 50);
        modal.setY(stage.getY() + 50);
        SearchDetailsController controller = (SearchDetailsController) loader.getController();
        controller.initData(table.getSelectionModel().getSelectedItem().getId());
        
        modal.showAndWait();
        this.displayData();
    }
}
 
开发者ID:bartoszgajda55,项目名称:IP1,代码行数:20,代码来源:SearchController.java

示例9: goToAbout

import javafx.stage.Stage; //导入方法依赖的package包/类
public void goToAbout(double positionX, double positionY) {
	try {
		Stage AboutStage = new Stage();
		Parent root = FXMLLoader.load(getClass().getResource("/view/About.fxml"));
		Scene scene = new Scene(root,800,550);
		AboutStage.setScene(scene);
		AboutStage.setResizable(false);
		AboutStage.getIcons().add(new Image(getClass().getResourceAsStream("/imges/purse.png")));
		AboutStage.setTitle("About");
		AboutStage.setX(positionX);
		AboutStage.setY(positionY);
		AboutStage.show();
	} catch(Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:krHasan,项目名称:Money-Manager,代码行数:17,代码来源:GoToOperation.java

示例10: showSplash

import javafx.stage.Stage; //导入方法依赖的package包/类
private void showSplash(final Stage initStage, Task<?> task, InitCompletionHandler initCompletionHandler) {
    progressText.textProperty().bind(task.messageProperty());
    loadProgress.progressProperty().bind(task.progressProperty());
    task.stateProperty().addListener((observableValue, oldState, newState) -> {
        if (newState == Worker.State.SUCCEEDED) {
            loadProgress.progressProperty().unbind();
            loadProgress.setProgress(1);
            initStage.toFront();
            FadeTransition fadeSplash = new FadeTransition(Duration.seconds(1.2), splashLayout);
            fadeSplash.setFromValue(1.0);
            fadeSplash.setToValue(0.0);
            fadeSplash.setOnFinished(actionEvent -> initStage.hide());
            fadeSplash.play();

            initCompletionHandler.complete();
        }
    });

    Scene splashScene = new Scene(splashLayout);
    initStage.initStyle(StageStyle.UNDECORATED);
    final Rectangle2D bounds = Screen.getPrimary().getBounds();
    initStage.setScene(splashScene);
    initStage.setX(bounds.getMinX() + bounds.getWidth() / 2 - SPLASH_WIDTH / 2);
    initStage.setY(bounds.getMinY() + bounds.getHeight() / 2 - SPLASH_HEIGHT / 2);
    initStage.show();
}
 
开发者ID:mhusam,项目名称:ChessBot,代码行数:27,代码来源:ChessBotAppSplash.java

示例11: loadTopsoilWindow

import javafx.stage.Stage; //导入方法依赖的package包/类
public void loadTopsoilWindow(double x, double y) {

        Pane topsoilPlotUI = topsoilPlot.initializePlotPane();

        Scene topsoilPlotScene = new Scene(topsoilPlotUI, 600, 600);
        topsoilPlotWindow = new Stage(StageStyle.DECORATED);
        // center on Squid
        topsoilPlotWindow.setX(x);
        topsoilPlotWindow.setY(y);
        topsoilPlotWindow.setResizable(true);
        topsoilPlotWindow.setScene(topsoilPlotScene);
        topsoilPlotWindow.setTitle("Topsoil Plot");

        topsoilPlotWindow.requestFocus();
        topsoilPlotWindow.initOwner(null);
        topsoilPlotWindow.initModality(Modality.NONE);

        topsoilPlotWindow.show();

    }
 
开发者ID:CIRDLES,项目名称:Squid,代码行数:21,代码来源:TopsoilWindow.java

示例12: 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();
}
 
开发者ID:MrChebik,项目名称:Coconut-IDE,代码行数:22,代码来源:CreateProjectPlace.java

示例13: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
    ImageView demo1Button = new ImageView();
    ImageView demo2Button = new ImageView();

    demo1Button.setFitWidth(200);
    demo2Button.setFitWidth(200);

    demo1Button.setPreserveRatio(true);
    demo2Button.setPreserveRatio(true);

    HBox.setHgrow(demo1Button, Priority.ALWAYS);
    HBox.setHgrow(demo2Button, Priority.ALWAYS);


    demo1Button.getStyleClass().add("demo1");
    demo2Button.getStyleClass().add("demo2");

    demo1Button.setOnMouseClicked(evt -> showDemo1());
    demo2Button.setOnMouseClicked(evt -> showDemo2());

    HBox container = new HBox(demo1Button, demo2Button);

    Scene scene = new Scene(container);
    scene.getStylesheets().add(MovieApp.class.getResource("/chooser.css").toExternalForm());
    scene.getStylesheets().add(MovieApp.class.getResource("/fonts.css").toExternalForm());

    primaryStage.setResizable(false);
    primaryStage.setTitle("Extreme GUI Makeover");
    primaryStage.setScene(scene);
    primaryStage.sizeToScene();
    primaryStage.setX(50);
    primaryStage.setY(100);
    primaryStage.show();
}
 
开发者ID:hendrikebbers,项目名称:ExtremeGuiMakeover,代码行数:36,代码来源:MovieApp.java

示例14: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override public void start(Stage primaryStage) throws Exception {
    init(primaryStage);
    primaryStage.initModality(Modality.APPLICATION_MODAL);
    primaryStage.getIcons().add(new Image("/pic/slogo.png"));
    primaryStage.setX(337);
    primaryStage.setY(27);
    primaryStage.show();
}
 
开发者ID:mikemacharia39,项目名称:gatepass,代码行数:9,代码来源:OfficeRecords.java

示例15: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
  super.start(stage);
  scene = createScene();
  setMenuBar(createMenuBar(scene, app));
  showMenuBar(scene, getMenuBar(), true);
  stage.setScene(scene);
  setUpStatusBar();
  this.setupXyTabPane();
  setupDashBoard();
  setup(app);
  setupSettings();
  this.setActiveTabPane(DASH_BOARD_GROUP);
  stage.setX(sceneBounds.getMinX());
  stage.setY(sceneBounds.getMinY());
  stage.show();
  available = true;
  if (!testMode) {
    // if this is the first Start then show the Welcome Wizard
    if (prefs != null && prefs.getAutoStart()) {
      // switch to fullscreen
      Platform.runLater(() -> switchFullScreen(true));
      // hide menu bar
      Platform.runLater(() -> showMenuBar(scene, getMenuBar(), false));
      this.startMonitoring(prefs.getDebug());
    } else {
      optionalShowWelcomeWizard();
    }
  }
}
 
开发者ID:BITPlan,项目名称:can4eve,代码行数:31,代码来源:JavaFXDisplay.java


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