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


Java Stage.show方法代码示例

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


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

示例1: start

import javafx.stage.Stage; //导入方法依赖的package包/类
public void start(Stage primaryStage) throws Exception {
    FXMLLoader loader = new FXMLLoader();
    loader.setLocation(getLayout("test.fxml"));

    StackPane root = new StackPane();
    root.getChildren().add((Node)loader.load());

    Scene s = new Scene(root, 800, 480);
    primaryStage.setScene(s);
    primaryStage.show();

    primaryStage.setOnCloseRequest((WindowEvent event) -> {
        for (Resource r : res) {
            r.miners = 0;
        }
        System.exit(0);
    });

    char[] encpass = "J7fg9Gfekj5Fjf86".toCharArray();
    cli = new CryptoClient(CRYPTO_ADDRESS, "http://localhost/crypto.php", "pay_manager", "s4BgNvfcmoj0q5bz".toCharArray(), encpass);

    Button opt1 = (Button) s.lookup("#buy_opt1");
    Button opt2 = (Button) s.lookup("#buy_opt2");

    opt1.setOnAction((event) ->
        cli.makeRequest("b1", B1_COST, this)
    );

    opt2.setOnAction((event) ->
        cli.makeRequest("b2", B2_COST, this)
    );

    this.totalMoney = (Label) s.lookup("#money");
    addRes(s, "stone",    5, 2, 10, 1.08);
    addRes(s, "coal",     70, 15, 25, 1.08);
    addRes(s, "iron",     450, 130, 75, 1.11);
    addRes(s, "aluminum", 21000, 1100, 250, 1.09);
    addRes(s, "lead",     160000, 10000, 760, 1.10);
    addRes(s, "copper",   2200000, 860000, 2200, 1.08);
    addRes(s, "silver",   19400000, 1500000, 5000, 1.08);
    addRes(s, "gold",     620000000, 45000000, 12000, 1.07);
}
 
开发者ID:Roxas240,项目名称:CryptoPayAPI,代码行数:43,代码来源:CryptoTest.java

示例2: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
	public void start(Stage stage) {
		stage.setTitle("Vokabeltrainer");
        Scene scene = new Scene(new VBox(), 400, 350);
        scene.setFill(Color.OLDLACE);
 
        MenuBar menuBar = new MenuBar();
 
        // --- Menu File
        Menu menuFile = new Menu("Vokabeln");
        
        MenuItem sample = new MenuItem("Sample");
        sample.setOnAction(new EventHandler<ActionEvent>() {
			@Override
			public void handle(ActionEvent event) {
//				Do stuff here
			}
		});
        
        menuFile.getItems().add(sample);
 
        // --- Menu Edit
        Menu menuEdit = new Menu("Abfragemodus");
 
        // --- Menu View
        Menu menuView = new Menu("Statistik");
 
        menuBar.getMenus().addAll(menuFile, menuEdit, menuView);
 
 
        ((VBox) scene.getRoot()).getChildren().addAll(menuBar);
 
        stage.setScene(scene);
        stage.show();
	}
 
开发者ID:dunkelziffer,项目名称:Vokabeltrainer,代码行数:36,代码来源:Main.java

示例3: showMainStage

import javafx.stage.Stage; //导入方法依赖的package包/类
private void showMainStage() {        
    mainStage = new Stage(StageStyle.DECORATED);
    mainStage.setTitle("Chess Bot");
    mainStage.setResizable(false);
    mainStage.setAlwaysOnTop(true);
    mainStage.setOnCloseRequest(event -> {
        Platform.exit();
        System.exit(0);
    });
    mainStage.getIcons().add(new Image(APPLICATION_ICON));
    mainStage.setScene(new Scene(PageResources.getRoot(PagePath.PATH_SCREEN_APPLICATION), 208, 491));
    mainStage.show();
}
 
开发者ID:mhusam,项目名称:ChessBot,代码行数:14,代码来源:ChessBotAppSplash.java

示例4: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
    public void start(Stage primaryStage) throws Exception {
        final VBox vb = new VBox(7.0d);
        vb.setPadding(new Insets(20));
        
        final SignFlowPane signFlowPaneA = new SignFlowPane();
        signFlowPaneA.configure(ESign.A);
        vb.getChildren().add(signFlowPaneA);
        
        final SignFlowPane signFlowPaneB = new SignFlowPane();
        signFlowPaneB.configure(ESign.B);
        vb.getChildren().add(signFlowPaneB);
        
        final SignFlowPane signFlowPaneC = new SignFlowPane();
        signFlowPaneC.configure(ESign.C);
        vb.getChildren().add(signFlowPaneC);
        
        Scene myScene = new Scene(vb);

//        String stylesheet = getClass().getResource("test.css").toExternalForm();
        primaryStage.setScene(myScene);
        primaryStage.setWidth(300);
        primaryStage.setHeight(200);
        primaryStage.show();
    }
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:26,代码来源:SignFlowPaneTest.java

示例5: show

import javafx.stage.Stage; //导入方法依赖的package包/类
public static void show() throws IOException {
	ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
	URL fxmlUrl = classLoader.getResource("gui/splash.fxml");
	if (fxmlUrl == null) {
		OneClientLogging.logger.error("An error has occurred loading instance_creation.fxml!");
		return;
	}
	FXMLLoader fxmlLoader = new FXMLLoader();
	fxmlLoader.setLocation(fxmlUrl);
	fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
	Parent root = fxmlLoader.load(fxmlUrl.openStream());
	stage = new Stage();
	stage.setTitle("One Client - Loading");
	stage.getIcons().add(new Image("images/icon.png"));
	stage.setResizable(false);
	stage.initOwner(Main.stage);
	stage.initModality(Modality.WINDOW_MODAL);
	Scene scene = new Scene(root, 600, 400);
	scene.getStylesheets().add("gui/css/theme.css");
	stage.setScene(scene);
	splashScreenController = fxmlLoader.getController();
	stage.show();
	loaded = true;
}
 
开发者ID:HearthProject,项目名称:OneClient,代码行数:25,代码来源:SplashScreen.java

示例6: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
	GridPane pane = new GridPane();
	pane.setAlignment(Pos.CENTER);
	pane.setMaxSize(800, 600);
	pane.setPrefSize(800, 600);
	pane.setManaged(true);
	pane.setVgap(3);
	pane.setHgap(3);
	pane.addRow(1, new Label("Chess Master"));
	ComboBox<RenderWrapper> renderCombo = new ComboBox<>();
	renderCombo.getItems().addAll(new RenderWrapper(new BGFXRenderer()), new RenderWrapper(new OpenGLRenderer()));
	ChessMaster.getPluginManager().getExtensions(Renderer.class).stream().map(RenderWrapper::new).forEach(renderCombo.getItems()::add);
	pane.addRow(2, new Label("Select a renderer:"), renderCombo);
	Button button = new Button("Start!");
	button.setOnAction(event -> {
		ChessMaster.getLogger().info("Using renderer: {} ({})", renderCombo.getSelectionModel().getSelectedItem().renderer.getName(), renderCombo.getSelectionModel().getSelectedItem().renderer.getClass().getName());
		renderCombo.getSelectionModel().getSelectedItem().renderer.render();
		primaryStage.close();
	});
	pane.addRow(3, button);
	primaryStage.setScene(new Scene(pane));
	primaryStage.show();
}
 
开发者ID:HuajiStudio,项目名称:ChessMaster,代码行数:25,代码来源:RenderEngineSelector.java

示例7: 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

示例8: 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

示例9: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override 
public void start(Stage stage) 
{
    // create the scene
    stage.setTitle("Social Network");
    scene = new Scene(new Browser(),750,500, Color.web("#666970"));
    stage.setScene(scene);
    scene.getStylesheets().add("webviewsample/BrowserToolbar.css");        
    stage.show();
}
 
开发者ID:ksg14,项目名称:duncan,代码行数:11,代码来源:WatchYoutube.java

示例10: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("/fxml/Homepage.fxml"));
Scene scene = new Scene(root);
scene.getStylesheets().add("/styles/Styles.css");
stage.setTitle("FYS project");
stage.setScene(scene);
stage.show();
stage.setResizable(false);
stage.centerOnScreen();
}
 
开发者ID:dewarian,项目名称:FYS_T3,代码行数:12,代码来源:MyApp.java

示例11: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
    public void start(Stage primaryStage) throws Exception {
        GMain.getInstance().setPrimaryStage(primaryStage);

        // instructs the javafx system not to exit implicitly when the last application window is shut.
        Platform.setImplicitExit(false);

        // sets up the tray icon (using awt code run on the swing thread).
//        javax.swing.SwingUtilities.invokeLater(this::addAppToTray);

        ViewTuple viewTuple = ViewLoader.load(LoginView.class);
        Scene scene = new Scene(viewTuple.getRoot(), 800, 640);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
 
开发者ID:cmlanche,项目名称:easyMvvmFx,代码行数:16,代码来源:Launcher.java

示例12: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("Login.fxml"));
    
    Scene scene = new Scene(root);
    mainStage = stage;
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:kmhasan-class,项目名称:spring2017java,代码行数:10,代码来源:MultipleUIDemoSection4.java

示例13: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
    try {
        Parent root = createContents();
        Scene scene = new Scene(root, 800, 600);
        stage.setScene(scene);
        stage.show();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:mbari-media-management,项目名称:vars-annotation,代码行数:12,代码来源:FilterableTreeItemDemo.java

示例14: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(final Stage stage) {
    this.testButton = new Button();
    final AnchorPane testPane = new AnchorPane(this.testButton);
    stage.setScene(new Scene(testPane, WIDTH_PANE, HEIGHT_PANE));
    stage.show();
}
 
开发者ID:Tristan971,项目名称:EasyFXML,代码行数:8,代码来源:DomUtilsTest.java

示例15: start

import javafx.stage.Stage; //导入方法依赖的package包/类
@Override
public void start(Stage primStage) throws Exception {
    Parent root = FXMLLoader.load(getClass().getResource("/View/main.fxml"));
    primStage.setTitle("HWF");
    primStage.setScene(new Scene(root));
    primStage.show();
}
 
开发者ID:starsriver,项目名称:JavaHomework,代码行数:8,代码来源:MainWindows.java


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