0

im trying to write data to TableView but string data didnt show , here what i tried to do

in model

public String getAdress() {
        return Adress.get();
    }

    public void setAdress(SimpleStringProperty adress) {
        Adress = adress;
    } 
    public HouseInfo(int No, String adress, S, double price, boolean availability) {
        super();
        HouseNo = No;
        Adress = new SimpleStringProperty(adress);
        Price = new SimpleDoubleProperty(price);
        Availability = new SimpleBooleanProperty(availability);
    }```

in controller

@FXML
    private TableColumn<HouseInfo, String> Adress;
Adress.setCellValueFactory(new PropertyValueFactory<>("Address"));

 private ObservableList<HouseInfo> getHouses(){
        ObservableList<HouseInfo> house = FXCollections.observableArrayList();
        house.add(new HouseInfo(1,"Al Khor","two bed Room",3000, true));
        house.add(new HouseInfo(1,"Al Khor","two bed Room",3000, true));
    return house ;}

everything else shows except this one

AAA
  • 17
  • 5
  • You're just adding a String "Address", what are you expecting? –  Apr 17 '20 at 12:06
  • 1
    `"Address"` in the `PropertyValueFactory` but `getAdress()` in the model.... Read the linked question to understand how to make this work. Better still, just don't use `PropertyValueFactory` at all; use a lambda expression to map to the property accessor. – James_D Apr 17 '20 at 12:06

0 Answers0