Questions tagged [javafx-bindings]
15 questions
9
votes
2 answers
How to bind a value to an ObservableList's size?
I want to bind a value to the ObservableList's size to know its size and also to know if it has multiple values
private ObservableList strings = FXCollections.observableArrayList();

msj121
- 2,812
- 3
- 28
- 55
7
votes
1 answer
Why does binding a TextField to a property which is being updated on another thread end up with the application throwing errors?
I have a javafx application where I have multiple tabs (timer, stopwatch, clock) each with a separate Controller, and the user is able to add and independently start multiple timers using a start/stop button.
I tried binding a TextField to a…

roman
- 151
- 1
- 9
7
votes
1 answer
JavaFX: Initial value of bidirectional binding
What happens when I do binding for these two properties?
ObjectProperty

Jai
- 8,165
- 2
- 21
- 52
3
votes
1 answer
Bind CheckBoxTableCell to BooleanBinding
I want to bind a CheckBox in a TableViewCell to a BooleanBinding. The following sample consists of a TableView with a column name and isEffectiveRequired. The checkbox in the column is bound to the Expression:
isRequired.or(name.isEqualTo("X"))
So…

kfaria
- 307
- 2
- 13
2
votes
1 answer
JavaFX: Bind SimpleLongProperty to a Label and format long value to human readable filesize
I have a Label which is binded to two Properties. The first value (deletedFilesCountProperty) is a simple int without needing for formatting. But how can I format the second property (SimpleLongProperty) to a human readable filesize…

kanka.dev
- 57
- 7
2
votes
1 answer
JavaFX binding only applied after resizing the window
When I run the following code in the start method of my Main (JavaFX) class I get weird results. The window gets displayed but pane (with a green border) has a width of 0. It is supposed to have the same width as the container's height since I…

staad
- 796
- 8
- 20
2
votes
2 answers
Binding to a ObservableValue instead of an ObservableList with EasyBind
I've got a master/detail panel with ModelItem items. Each ModelItem has a ListProperty, and each ModelItemDetail has a few StringPropertys.
In the detail panel, I want to show a Label that will have its text bounded to and derived…

Xavi López
- 27,550
- 11
- 97
- 161
2
votes
1 answer
JavaFX: Binding to insets
I am pretty new to JavaFX and is fascinated by the binding capability. However, I could not figure out how to bind to the margin/padding of a node.
Currently, I am trying to make a textbox (or TextField) that has an image on the left. I made a…

Jai
- 8,165
- 2
- 21
- 52
1
vote
1 answer
JavaFX complex string binding
I'm new to JavaFX and was wondering if the Bindings API allowed an easier way to achieve the following. Consider a model that contains a database that may be null (because the database loads asynchronously) and a view that displays a label status…

Xunkar
- 115
- 1
- 10
1
vote
2 answers
JavaFX Disable TableColumn based on checkbox state
Am looking to disable a TableColumn tableColumn based on a field value in the CustomObject only when the TableColumn tableColumnTwo checkbox is checked. I can disable the textbox inside public void…

John C
- 1,795
- 4
- 27
- 42
1
vote
0 answers
Reverse select binding - possible?
I have a case that requires an object property's sub-property to be bound automatically to some defined property, but unbind old and rebind new on any change in the parent property; namely reverse select binding.
For illustration only (my case is…

Mordechai
- 15,437
- 2
- 41
- 82
1
vote
1 answer
How to get BooleanBinding from comparing 2 DatePickers?
I have two DatePickers and one Button on the GUI. I need to disable the button whenever the first datePicker has a date that is NOT before the second datePicker's date. i.e. before is false in the following snippet:
LocalDate date1 =…

Eng.Fouad
- 115,165
- 71
- 313
- 417
0
votes
0 answers
How to bind BorderPane's center node's dimensions to an ImageView
I have a JavaFX BorderPane in which I add an ImageView as the center node of the BorderPane. The ImageView becomes very big, and overlapsed other nodes.
I want to set the dimensions of the ImageView programmatically for the case that the user…

kanka.dev
- 57
- 7
0
votes
2 answers
Timer in JavaFX updating Label (Bindings)
I want to add a clock to my application that tells how long you have been doing the task. To simplify it, I have included a counter that increments every second in a new thread and update the label 'setTimer' with the counter number. For this I have…

Jens
- 17
- 1
- 4
-1
votes
2 answers
How to not lose decimal places when doing "longProperty1.divide(longProperty2)"?
I have two LongProperty (there are no decimal places in a long) variables (longProperty1 and longProperty2). I need to divide them and I need to keep the division result in a DoubleProperty (there are decimal places in a double) variable (result)…

Douglas
- 101
- 4