title: How to check if the checkbox is selected or not
body: <p>I made a custom listview, following is the code:</p>
  
  <pre><code>ListView&lt;Sector&gt; sectorList = new ListView();
  sectorList.setStyle("-fx-font-size: 21px;");
  sectorList.setItems(data2);
  sectorList.setCellFactory(new Callback&lt;ListView&lt;Sector&gt;, ListCell&lt;Sector&gt;&gt;() {
      @Override
      public ListCell&lt;Sector&gt; call(ListView&lt;Sector&gt; param) {
          return new XCell();
      }
  });
  </code></pre>
  
  <p>.</p>
  
  <pre><code>class XCell extends ListCell&lt;Sector&gt;{
      @Override
      protected void updateItem(Sector sector, boolean empty){
          super.updateItem(sector, empty);
          if(!empty){
              CheckBox checkbox = new CheckBox(sector.getName());
              checkbox.setStyle("-fx-font-weight: bold;");
              checkbox.setSelected(true);
  
              Label label = new Label("          "+sector.getDescription());
              label.setStyle("-fx-font-style: italic;");
  
              VBox root = new VBox(5);
              root.setPadding(new Insets(8));
              root.getChildren().addAll(checkbox,label);
  
              setGraphic(root);
          }else{
              setGraphic(null);
          }
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/DxiYU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DxiYU.png" alt="enter image description here"></a></p>
  
  <p>Is there a way to loop through the listview's items and check if the checkbox is selected or not? How?</p>