I have a
Tab called chat. Inside this Tab I have a list of users as
The content of this
ListView was loaded from FXML file using:
I am trying to add items to my
listview using java, but when I open the GUI, chat tab, the items I add does not get displayed in the users
One of the ways I tried was:
List<String> values = Arrays.asList("one", "two", "three"); listOfUsers.setItems(FXCollections.observableList(values));
I have tried other ways as well, but nothing seems to work. I'd appreciate your help.
the problem was that my listView of users was created by the FXML loader, and then by mistake i initialized it again in the java code, so all was needed is deleting the row:
the file chat.fxml has fx:controller?!
xmlns:fx="http://javafx.com/fxml" fx:controller="DIRECTORY.FILE" //FILE.java