FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaFX/src/bind/j.java at master · rtirl/JavaFX · GitHub
rtirl
/
JavaFX
Public
forked from
dmpe/JavaFX
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaFX
/
src
/
bind
/
j.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (29 loc) · 1009 Bytes
Breadcrumbs
JavaFX
/
src
/
bind
/
j.java
Copy path
File metadata and controls
39 lines (29 loc) · 1009 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package
bind
;
import
javafx
.
beans
.*;
import
javafx
.
beans
.
binding
.*;
public
class
j
{
public
static
void
main
(
String
[]
args
) {
bill
bill1
=
new
bill
();
bill
bill2
=
new
bill
();
bill
bill3
=
new
bill
();
NumberBinding
total
=
Bindings
.
add
(
bill1
.
amountDueProperty
().
add
(
bill2
.
amountDueProperty
()),
bill3
.
amountDueProperty
());
total
.
addListener
(
new
InvalidationListener
() {
@
Override
public
void
invalidated
(
Observable
o
) {
System
.
out
.
println
(
"The binding is now invalid."
);
}
});
// First call makes the binding invalid
bill1
.
setAmountDue
(
200.00
);
// The binding is now invalid
bill2
.
setAmountDue
(
100.00
);
bill3
.
setAmountDue
(
75.00
);
// Make the binding valid...
System
.
out
.
println
(
total
.
getValue
());
// Make invalid...
bill3
.
setAmountDue
(
150.00
);
// Make valid...
System
.
out
.
println
(
total
.
getValue
());
}
}
Back
|
FazBrowse Home
|
New Git URL