[Solved] How to create Getter and Setter for TableView


You need a data structure to help you out. Consider using a list.

public class CatTable {
    List<SimpleStringProperty> properties = new ArrayList<>();
    public void addProperty(SimpleStringProperty property) {
        properties.add(property);
    }
    public SimpleStringProperty getProperty(int index) {
        return properties.get(index);
    }
    public String getPropertyValue(int index) {
        return getProperty(index).get();
    }
    // other stuff...
}

This way you have a single point of storage and only one method to get any properties you need. Keep in mind Java’s lists are 0 based so when you add property 1 it will be stored at index 0.

solved How to create Getter and Setter for TableView