diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java index 2bb34ffd67..c3d89aad2f 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java @@ -182,7 +182,7 @@ public abstract class PaymentMethodForm { getTimeText(hours), formatter.formatCoinWithCode(Coin.valueOf(accountAgeWitnessService.getMyTradeLimit(paymentAccount, tradeCurrency.getCode()))), formatter.formatAccountAge(accountAge)); - addTextField(gridPane, ++gridRow, Res.get("payment.limitations"), limitationsText); + addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.limitations"), limitationsText); if (isAddAccountScreen) { InputTextField inputTextField = addInputTextField(gridPane, ++gridRow, Res.get("payment.salt"), 0); @@ -277,12 +277,12 @@ public abstract class PaymentMethodForm { TradeCurrency singleTradeCurrency) { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), accountName, Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(paymentMethod.getId())); - TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.no"), accountNr).second; + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(paymentMethod.getId())); + TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.no"), accountNr).second; field.setMouseTransparent(false); final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PromptPayForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PromptPayForm.java index 3fac750eef..14aa20b367 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PromptPayForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PromptPayForm.java @@ -35,7 +35,6 @@ import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; import static bisq.desktop.util.FormBuilder.addInputTextField; -import static bisq.desktop.util.FormBuilder.addTextField; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; public class PromptPayForm extends PaymentMethodForm { @@ -71,7 +70,7 @@ public class PromptPayForm extends PaymentMethodForm { TradeCurrency singleTradeCurrency = promptPayAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - addTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); addAccountNameTextFieldWithAutoFillToggleButton(); } @@ -84,16 +83,16 @@ public class PromptPayForm extends PaymentMethodForm { @Override public void addFormForDisplayAccount() { gridRowFrom = gridRow; - addTextField(gridPane, gridRow, Res.get("payment.account.name"), + addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), promptPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - addTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(promptPayAccount.getPaymentMethod().getId())); - TextField field = addTextField(gridPane, ++gridRow, Res.get("payment.promptPay.promptPayId"), - promptPayAccount.getPromptPayId()); + TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.promptPay.promptPayId"), + promptPayAccount.getPromptPayId()).second; field.setMouseTransparent(false); TradeCurrency singleTradeCurrency = promptPayAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - addTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } diff --git a/desktop/src/main/java/bisq/desktop/util/FormBuilder.java b/desktop/src/main/java/bisq/desktop/util/FormBuilder.java index aaac070035..534450758d 100644 --- a/desktop/src/main/java/bisq/desktop/util/FormBuilder.java +++ b/desktop/src/main/java/bisq/desktop/util/FormBuilder.java @@ -196,29 +196,6 @@ public class FormBuilder { return label; } - /////////////////////////////////////////////////////////////////////////////////////////// - // TextField - /////////////////////////////////////////////////////////////////////////////////////////// - - public static TextField addTextField(GridPane gridPane, int rowIndex, String title, String value) { - return addTextField(gridPane, rowIndex, title, value, 0); - } - - public static TextField addTextField(GridPane gridPane, int rowIndex, String title, String value, double top) { - TextField textField = new JFXTextField(value); - ((JFXTextField) textField).setLabelFloat(true); - textField.setPromptText(title); - textField.setEditable(false); - textField.setMouseTransparent(true); - textField.setFocusTraversable(false); - - GridPane.setRowIndex(textField, rowIndex); - GridPane.setMargin(textField, new Insets(top + Layout.FLOATING_LABEL_DISTANCE, 0, 0, 0)); - gridPane.getChildren().add(textField); - - return textField; - } - /////////////////////////////////////////////////////////////////////////////////////////// // Label + TextField ///////////////////////////////////////////////////////////////////////////////////////////