-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.java
More file actions
46 lines (36 loc) · 919 Bytes
/
Copy pathBook.java
File metadata and controls
46 lines (36 loc) · 919 Bytes
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
import javafx.scene.control.CheckBox;
public class Book {
private String name;
private double price;
private CheckBox select;
public Book(String name, double price){
this.name = name;
this.price = price;
this.select = new CheckBox();
}
public String getName() {
return name;
}
public double getPrice() {
return price;
}
public void setName(String name) {
this.name = name;
}
public void setPrice(double price) {
this.price = price;
}
public CheckBox getSelect() {
return select;
}
public void setSelect(CheckBox select) {
this.select = select;
}
public String getTitle() {
return name;
}
@Override
public String toString() {
return name + " ($" + String.format("%.2f", price) + ")";
}
}