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);
}
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);
}
});
}
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);
});
}
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;
}
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();
}
Aggregations