-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaFXPropertyTest.java
More file actions
58 lines (48 loc) · 1.21 KB
/
Copy pathJavaFXPropertyTest.java
File metadata and controls
58 lines (48 loc) · 1.21 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* Copyright (c) 2016 by amphorainc.com. All rights reserved.
* created on Dec 6, 2016
*/
package application;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleIntegerProperty;
/**
* @author Saravana Kumar M
*
*/
public class JavaFXPropertyTest
{
private final IntegerProperty amount = new SimpleIntegerProperty();
public final void setAmount(final Integer amount)
{
this.amount.set(amount);
}
public final Integer getAmount()
{
return this.amount.get();
}
public IntegerProperty amountProperty()
{
return this.amount;
}
private BooleanProperty isTrue = new SimpleBooleanProperty();
public BooleanProperty isTrueProperty()
{
if(this.isTrue == null)
{
this.isTrue = new SimpleBooleanProperty();
}
return this.isTrue;
}
public static void main(final String[] args)
{
final JavaFXPropertyTest ob = new JavaFXPropertyTest();
System.out.println(ob.amountProperty());
System.out.println(ob.getAmount());
ob.setAmount(100);
System.out.println(ob.getAmount());
System.out.println("=====================");
System.out.println(ob.isTrueProperty());
}
}