當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。