Search in sources :

Example 26 with Button

use of javafx.scene.control.Button in project bitsquare by bitsquare.

the class EnterPrivKeyWindow method addButtons.

private void addButtons() {
    unlockButton = new Button("Unlock");
    unlockButton.setDefaultButton(true);
    unlockButton.setDisable(keyInputTextField.getText().length() == 0);
    unlockButton.setOnAction(e -> {
        if (privKeyHandler.checkKey(keyInputTextField.getText()))
            hide();
        else
            new Popup().warning("The key you entered was not correct.").width(300).onClose(() -> blurAgain()).show();
    });
    Button cancelButton = new Button("Close");
    cancelButton.setOnAction(event -> {
        hide();
        closeHandlerOptional.ifPresent(closeHandler -> closeHandler.run());
    });
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    GridPane.setRowIndex(hBox, ++rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    hBox.getChildren().addAll(unlockButton, cancelButton);
    gridPane.getChildren().add(hBox);
}
Also used : HBox(javafx.scene.layout.HBox) Button(javafx.scene.control.Button) Popup(io.bitsquare.gui.main.overlays.popups.Popup)

Example 27 with Button

use of javafx.scene.control.Button in project bitsquare by bitsquare.

the class OfferDetailsWindow method addConfirmAndCancelButtons.

private void addConfirmAndCancelButtons(boolean isPlaceOffer) {
    boolean isBuyOffer = offer.getDirection() == Offer.Direction.BUY;
    boolean isBuyerRole = isPlaceOffer ? isBuyOffer : !isBuyOffer;
    String placeOfferButtonText = isBuyerRole ? "Confirm offer to buy bitcoin" : "Confirm offer to sell bitcoin";
    String takeOfferButtonText = isBuyerRole ? "Confirm offer to buy bitcoin" : "Confirm offer to sell bitcoin";
    ImageView iconView = new ImageView();
    iconView.setId(isBuyerRole ? "image-buy-white" : "image-sell-white");
    Tuple3<Button, BusyAnimation, Label> placeOfferTuple = addButtonBusyAnimationLabelAfterGroup(gridPane, ++rowIndex, isPlaceOffer ? placeOfferButtonText : takeOfferButtonText);
    Button button = placeOfferTuple.first;
    button.setMinHeight(40);
    button.setPadding(new Insets(0, 20, 0, 20));
    button.setGraphic(iconView);
    button.setGraphicTextGap(10);
    button.setId(isBuyerRole ? "buy-button-big" : "sell-button-big");
    button.setText(isPlaceOffer ? placeOfferButtonText : takeOfferButtonText);
    busyAnimation = placeOfferTuple.second;
    Label spinnerInfoLabel = placeOfferTuple.third;
    Button cancelButton = addButton(gridPane, ++rowIndex, BSResources.get("shared.cancel"));
    cancelButton.setDefaultButton(false);
    cancelButton.setId("cancel-button");
    cancelButton.setOnAction(e -> {
        closeHandlerOptional.ifPresent(Runnable::run);
        hide();
    });
    button.setOnAction(e -> {
        if (user.getAcceptedArbitrators().size() > 0) {
            button.setDisable(true);
            cancelButton.setDisable(true);
            busyAnimation.play();
            if (isPlaceOffer) {
                spinnerInfoLabel.setText(BSResources.get("createOffer.fundsBox.placeOfferSpinnerInfo"));
                placeOfferHandlerOptional.get().run();
            } else {
                spinnerInfoLabel.setText(BSResources.get("takeOffer.fundsBox.takeOfferSpinnerInfo"));
                takeOfferHandlerOptional.get().run();
            }
        } else {
            new Popup().warning("You have no arbitrator selected.\n" + "Please select at least one arbitrator.").show();
            navigation.navigateTo(MainView.class, AccountView.class, AccountSettingsView.class, ArbitratorSelectionView.class);
        }
    });
}
Also used : BusyAnimation(io.bitsquare.gui.components.BusyAnimation) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) Popup(io.bitsquare.gui.main.overlays.popups.Popup) Label(javafx.scene.control.Label) ImageView(javafx.scene.image.ImageView)

Example 28 with Button

use of javafx.scene.control.Button in project bitsquare by bitsquare.

the class Overlay method addReportErrorButtons.

private void addReportErrorButtons() {
    messageLabel.setText(truncatedMessage + "\n\nTo help us to improve the software please report the bug at our issue tracker at Github or send it by email to the developers.\n" + "The error message will be copied to clipboard when you click the below buttons.\n" + "It will make debugging easier if you can attach the bitsquare.log file which you can find in the application directory.");
    Button githubButton = new Button("Report to Github issue tracker");
    GridPane.setMargin(githubButton, new Insets(20, 0, 0, 0));
    GridPane.setHalignment(githubButton, HPos.RIGHT);
    GridPane.setRowIndex(githubButton, ++rowIndex);
    GridPane.setColumnIndex(githubButton, 1);
    gridPane.getChildren().add(githubButton);
    githubButton.setOnAction(event -> {
        Utilities.copyToClipboard(message);
        GUIUtil.openWebPage("https://github.com/bitsquare/bitsquare/issues");
    });
    Button mailButton = new Button("Report by email");
    GridPane.setHalignment(mailButton, HPos.RIGHT);
    GridPane.setRowIndex(mailButton, ++rowIndex);
    GridPane.setColumnIndex(mailButton, 1);
    gridPane.getChildren().add(mailButton);
    mailButton.setOnAction(event -> {
        Utilities.copyToClipboard(message);
        GUIUtil.openMail("manfred@bitsquare.io", "Error report", "Error message:\n" + message);
    });
}
Also used : Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button)

Example 29 with Button

use of javafx.scene.control.Button in project fx2048 by brunoborges.

the class GamePane method createButtonItem.

private Button createButtonItem(String symbol, String text, EventHandler<ActionEvent> t) {
    Button g = new Button();
    g.setPrefSize(40, 40);
    g.setId(symbol);
    g.setOnAction(t);
    g.setTooltip(new Tooltip(text));
    return g;
}
Also used : Button(javafx.scene.control.Button) Tooltip(javafx.scene.control.Tooltip)

Example 30 with Button

use of javafx.scene.control.Button in project Gargoyle by callakrsos.

the class AbsoltePointFocusExam method start.

@Override
public void start(Stage stage) throws Exception {
    // 포커스
    ScrollPane scrPane = new ScrollPane();
    scrPane.setPrefWidth(ScrollPane.USE_COMPUTED_SIZE);
    BorderPane borderPane = new BorderPane(scrPane);
    Scene scene = new Scene(borderPane, Color.LINEN);
    VBox vbox = new VBox();
    VBox.setVgrow(vbox, Priority.ALWAYS);
    vbox.setPrefWidth(VBox.USE_PREF_SIZE);
    vbox.setPrefHeight(VBox.USE_COMPUTED_SIZE);
    for (int i = 0; i < 20; i++) {
        AnchorPane ancPane = new AnchorPane();
        AnchorPane ancPane2 = new AnchorPane();
        ancPane2.setLayoutY(500);
        TextField text1 = new TextField();
        TextField text2 = new TextField();
        text2.setLayoutY(800);
        Button btn = new Button("Focus" + i);
        btn.setOnMouseClicked(event -> {
            text2.requestFocus();
            double absolteY = FxUtil.getAbsolteY(vbox, text2) + text2.getHeight();
            scrPane.setVvalue((absolteY / vbox.getHeight()));
        });
        btn.setLayoutX(150);
        ancPane2.getChildren().add(text2);
        ancPane.getChildren().addAll(text1, btn, ancPane2);
        vbox.getChildren().add(ancPane);
    }
    scrPane.setContent(vbox);
    stage.setWidth(700);
    stage.setHeight(400);
    Label status = new Label();
    borderPane.setBottom(status);
    vbox.addEventFilter(MouseEvent.ANY, event -> {
        status.textProperty().set(String.format(" x: %s y : %s scene x : %s scene y : %s screen x :%s screen y : %s", event.getX(), event.getY(), event.getSceneX(), event.getSceneY(), event.getScreenX(), event.getScreenY()));
    });
    stage.setScene(scene);
    stage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) Button(javafx.scene.control.Button) ScrollPane(javafx.scene.control.ScrollPane) Label(javafx.scene.control.Label) TextField(javafx.scene.control.TextField) Scene(javafx.scene.Scene) VBox(javafx.scene.layout.VBox) AnchorPane(javafx.scene.layout.AnchorPane)

Aggregations

Button (javafx.scene.control.Button)101 Label (javafx.scene.control.Label)33 Scene (javafx.scene.Scene)30 Insets (javafx.geometry.Insets)25 HBox (javafx.scene.layout.HBox)23 BorderPane (javafx.scene.layout.BorderPane)20 VBox (javafx.scene.layout.VBox)16 TextField (javafx.scene.control.TextField)14 Tooltip (javafx.scene.control.Tooltip)13 File (java.io.File)11 Stage (javafx.stage.Stage)11 IOException (java.io.IOException)10 ImageView (javafx.scene.image.ImageView)10 MouseButton (javafx.scene.input.MouseButton)9 Popup (io.bitsquare.gui.main.overlays.popups.Popup)8 ArrayList (java.util.ArrayList)8 Node (javafx.scene.Node)8 TextArea (javafx.scene.control.TextArea)8 GridPane (javafx.scene.layout.GridPane)8 InputTextField (io.bitsquare.gui.components.InputTextField)7