link to full project .zip (Inventory System for College) https://www.dropbox.com/s/t88vsjt7awmlv93/MattNapper.zip?dl=0
Trying to get data to show in tableview using ObservableList. Part Model is an abstract. InHousePart, and OutsoucredPart extend Part. Inventory is where I declare ObservableList, fake data, return ObservableList method
In my Inventory class I have:
public class Inventory {
//declaring arrays for parts, and products
private ObservableList<Product> products = FXCollections.observableArrayList();
private ObservableList<Part> allParts = FXCollections.observableArrayList();
//fake data
//**This is where the error incompatible types: int cant be converted to Integer Property**
InHousePart part1 = new InHousePart (1, 1, "pick", 10.00, 1, 1, 5 );
//adds fake data to "allParts" arraylist
public void addData() {
allParts.add(part1);
}
public ObservableList<Part> getPartData() {
return allParts;
}
InHousePart Class
public class InHousePart extends Part{
//constructors
private IntegerProperty machineID;
public IntegerProperty getMachineID() {
return machineID;
}
public void setMachineID(IntegerProperty machineID) {
this.machineID = machineID;
}
//constructor
public InHousePart(IntegerProperty machineID, IntegerProperty partID, StringProperty name, DoubleProperty price, IntegerProperty inStock, IntegerProperty min, IntegerProperty max) {
super(partID, name, price, inStock, min, max);
this.machineID = machineID;
}
Part Class
public abstract class Part {
private IntegerProperty partID;
private StringProperty name;
private DoubleProperty price;
private IntegerProperty inStock;
private IntegerProperty min;
private IntegerProperty max;
public IntegerProperty getPartID() {
return partID;
}
public void setPartID(IntegerProperty partID) {
this.partID = partID;
}
public StringProperty getName() {
return name;
}
public void setName(StringProperty name) {
this.name = name;
}
public DoubleProperty getPrice() {
return price;
}
public void setPrice(DoubleProperty price) {
this.price = price;
}
public IntegerProperty getInStock() {
return inStock;
}
public void setInStock(IntegerProperty inStock) {
this.inStock = inStock;
}
public IntegerProperty getMin() {
return min;
}
public void setMin(IntegerProperty min) {
this.min = min;
}
public IntegerProperty getMax() {
return max;
}
public void setMax(IntegerProperty max) {
this.max = max;
}
//constructor
public Part(IntegerProperty partID, StringProperty name, DoubleProperty price, IntegerProperty inStock, IntegerProperty min, IntegerProperty max) {
this.partID = partID;
this.name = name;
this.price = price;
this.inStock = inStock;
this.min = min;
this.max = max;
}
}