title: How to populate a TableView that is defined in an fxml file that is designed in JavaFx Scene Builder
body: <p>I would like to know how do I populate a TableView with data... All the examples I have seen creates a TableView with columns and everything and add it to the scene. All done in the java code itself.</p>
  
  <p>What I want to know: if I design my "form" in JavaFx Scene builder. Defining all the tables and columns in there. How do I access it to populate it from java? Or if someone can point me to a proper tutorial on this please.</p>
  
  <p>I have defined my form in JavaFx Scene Builder - only a TableView with 3 Columns</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import java.lang.*?&gt;
  &lt;?import java.util.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.scene.paint.*?&gt;
  
  &lt;AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="288.0" prefWidth="293.0" xmlns:fx="http://javafx.com/fxml"&gt;
  &lt;children&gt;
      &lt;TableView fx:id="tableView" layoutX="35.0" layoutY="28.0" prefHeight="200.0" prefWidth="227.0"&gt;
      &lt;columns&gt;
          &lt;TableColumn prefWidth="75.0" text="UserId" fx:id="UserId" /&gt;
          &lt;TableColumn prefWidth="75.0" text="UserName" fx:id="UserName" /&gt;
          &lt;TableColumn prefWidth="75.0" text="Active" fx:id="Active" /&gt;
      &lt;/columns&gt;
      &lt;/TableView&gt;
  &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>I have my data in a ResultSet in my Java code.</p>
  
  <pre><code>ResultSet rs = c.createStatement().executeQuery(SQL);
  </code></pre>
  
  <p>I need to populate the TableView.</p>
  
  <p>Thanks</p>