javafx - Hide Calendar Button on DatePicker? -
is there simple way hide calendar button on datepicker node in javafx? of our dates not editable, , calendar button adding width of field.
you can use following css remove calendar button
.date-picker > .arrow-button { -fx-padding: 0px; } .date-picker > .arrow-button > .arrow { -fx-padding: 0px; }
edit - right border :
.date-picker > .date-picker-display-node { -fx-background-insets: 1 1 1 1; }
edit - apply above style few datepickers
declare datepicker , add styleclass it.
datepicker noneditabledatepicker = new datepicker(); noneditabledatepicker.getstyleclass().add("non-editable-datepicker");
use styleclass add styles :
.non-editable-datepicker > .arrow-button { -fx-padding: 0px; } .non-editable-datepicker > .arrow-button > .arrow { -fx-padding: 0px; } .non-editable-datepicker > .date-picker-display-node { -fx-background-insets: 1 1 1 1; }
Comments
Post a Comment