I have a TableView in JavaFX that I want to fill with some JSON data.
The JSON that I receive from the server looks like this:
{"mirelradoi":10,"test":6, "bob":3}
But I'm having a hard time understanding how to use this TableView. I created the TableView in SceneBuilder already (with its coresponding columns) so in my code I'm not initializing it anymore. (I don't think I still need it - I might be wrong, I'm a complete beginner :) )
And here's the way I'm adding that JSON in the tableview:
tabelClasament.setItems(FXCollections.observableArrayList(receivedJSON.get("clasament")));
Where tableClasament is the TableView I'm talking about, and receivedJSON.get("clasament") gets me the data that I've shown above.
But for some reason, I get this:
so I don't get "No content in the table" like not having data, but it doesn't show either.
How can I import that JSON into this table? The only thing in my code about the table is that line and the definition of tableClasament as TableView.
Thanks.