Beispiel #1
0
 @Override
 public void addFormForDisplayAccount() {
   gridRowFrom = gridRow;
   addLabelTextField(
       gridPane,
       gridRow,
       "Account name:",
       perfectMoneyAccount.getAccountName(),
       Layout.FIRST_ROW_AND_GROUP_DISTANCE);
   addLabelTextField(
       gridPane,
       ++gridRow,
       "Payment method:",
       BSResources.get(perfectMoneyAccount.getPaymentMethod().getId()));
   addLabelTextField(
       gridPane, ++gridRow, "Account holder name:", perfectMoneyAccount.getHolderName());
   TextField field =
       addLabelTextField(gridPane, ++gridRow, "Account nr.:", perfectMoneyAccount.getAccountNr())
           .second;
   field.setMouseTransparent(false);
   addLabelTextField(
       gridPane,
       ++gridRow,
       "Currency:",
       perfectMoneyAccount.getSingleTradeCurrency().getCodeAndName());
   addAllowedPeriod();
 }
 /**
  * Desactive le textfield passe en parametre
  *
  * @param textField le textfield a desactiver
  */
 public static void desactiverTextField(TextField textField) {
   textField.setEditable(false);
   textField.setMouseTransparent(true);
   textField.setFocusTraversable(false);
   textField.setText("");
   textField.setStyle("-fx-background-color:#cccccc");
 }
Beispiel #3
0
  public static Tuple2<Label, TextField> addLabelTextField(
      GridPane gridPane, int rowIndex, String title, String value, double top) {
    Label label = addLabel(gridPane, rowIndex, title, top);

    TextField textField = new TextField(value);
    textField.setEditable(false);
    textField.setMouseTransparent(true);
    textField.setFocusTraversable(false);
    GridPane.setRowIndex(textField, rowIndex);
    GridPane.setColumnIndex(textField, 1);
    GridPane.setMargin(textField, new Insets(top, 0, 0, 0));
    gridPane.getChildren().add(textField);

    return new Tuple2<>(label, textField);
  }
 /**
  * Active le textfield passe en parametre
  *
  * @param textField le textfield a activer
  */
 public static void activerTextField(TextField textField) {
   textField.setEditable(true);
   textField.setMouseTransparent(false);
   textField.setFocusTraversable(true);
   textField.setStyle(null);
 }