CryptoTest.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:CryptoPayAPI 作者:
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);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号