Answers for "javafx get listview fxml id"

0

javafx get listview fxml id

public class MainDriversController{

    @FXML
    private ListView<String> driversLV;

    private ObservableList<String> observableList = FXCollections.observableArrayList();

    public void initialize(){
        for(int x=0; x<Cparsing.driversNodes.getLength(); x++) {
            observableList.add(Cparsing.driversNodes.item(x).getAttributes().getNamedItem("nick").getNodeValue());
        }
        driversLV.setItems(observableList);
        System.out.println(driversLV);
    }
}
Posted by: Guest on May-26-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language