title: Printing out ObservableList<ObsevableList<String>>items from a tableview one item at a time
body: <p>I have Board model that I map to a tableView.  I can printout the entire selection, but I am trying to print out each line in the selection with special formatting. 
  Here is the model </p>
  
  <pre><code>public class Board (String pieceno, String avge, String lpte, String lptloc, String grade) {
  
      String PcNo;
      String AvgE;
      String LptE;
      String LptLoc;
      String Grade;
  
      public Board( {
          this.PcNo = pieceno;
          this.AvgE = avge;
          this.LptE = lpte;
          this.LptLoc = lptloc;
          this.Grade = grade;
      }
  
      public String getPcNo() {
          return PcNo;
      }
      public void setPcNo(String pcno) {
          PcNo = pcno;
      }
      pubic String getAvgE() {
          return AvgE;
      }
      public void setAvgE(String avge) {
          AvgE = avge;
      }
      public String getLptE() {
          return LptE;
      }
      public void setLptE(String lpte) {
          LptE = lpte;
      }
      public String getLptLoc() {
          return LptLoc;
      }
      public void setLptLoc(String lptloc) {
          LptLoc = lptloc;
      }
      public String getGrade() {
          return Grade;
      }
      public void setGrade(String gr) {
          Grade = gr; 
      }
  
      @Override
      public String toString() {
         return getPcNo() + "," + getAvgE() + "," + getLptE()
                           + "," + getLptLoc() + "," + getGrade() + "\n";
      }
  </code></pre>
  
  <p>}</p>
  
  <p>Now here is the code for tableView and selection of multiple rows. </p>
  
  <pre><code>TableView tableView = new TableView();
  tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
  
  
  TableColumn pcNoCol = new TableColumn();
  pcNoCol.setText("pcNo");
  pcNoCol.setCellValueFactory(new PropertyValueFactory("pcNo"));
  tableView.getColumns().add(pcNoCol);
  
  TableColumn avgECol = new TableColumn();
  avgECol.setText("avgE");
  avgECol.setCellValueFactory(new PropertyValueFactory("avgE"));
  tableView.getColumns().add(avgECol);
  
  TableColumn lptECol = new TableColumn();
  lptECol.setText("lptE");
  lptECol.setCellValueFactory(new PropertyValueFactory("lptE"));
  tableView.getColumns().add(lptECol);
  
  TableColumn lptLocCol = new TableColumn();
  lptLocCol.setText("lptLoc");
  lptLocCol.setCellValueFactory(new PropertyValueFactory("lptLoc"));
  tableView.getColumns().add(lptLocCol);
  
  TableColumn gradeCol = new TableColumn();
  gradeCol.setText("grade");
  gradeCol.setCellValueFactory(new PropertyValueFactory("grade"));
  tableView.getColumns().add(gradeCol);
  
  //Bindings. 
  p.progressProperty().bind(service.progressProperty());  
  veil.visibleProperty().bind(service.runningProperty());  
  p.visibleProperty().bind(service.runningProperty());  
  tableView.itemsProperty().bind(service.valueProperty());
  </code></pre>
  
  <p>Now the mouse event that grabs the rows and prints out selecteditems is </p>
  
  <pre><code>   tableView.setOnMousePressed((MouseEvent event) -&gt; {
          ObservableList&lt;ObservableList&lt;String&gt;&gt;selectedItems = tableView.getSelectionModel().getSelectedItems();
          //selectedItems.forEach(selecteditem -&gt; System.out.println(selecteditem));
          System.out.println(selectedItems);
      });
  </code></pre>
  
  <p>The code works, but Instead of println(selectedItems) I wish to print out each individual selected item,  I try the line that is commented out above the foreach line. but I get the following error. </p>
  
  <pre><code>Executing /home/jimbo/NetBeanProjects/AccountFXFrontEnd/dist/run12421/AccountFXFrontEnd.jar usring platform /usr/java/jdk1.8.0_91/jre/bin/java
  Exception in thread"JavaFX Application Thread" java.lang.ClassCastException: accountfxfrontend model Board cannot be cast  to javafx.collections.ObservableList
      at java.lang.Iterable.forEach Iterable.java.75
  </code></pre>
  
  <p>Can someone tell me what I need to do in order to print out each item rather than the collection?  Thanks. </p>
  
  <p>I should be obvious that I am new to javafx and collections I appreciate the help .. </p>
  
  <p>jimbo</p>