title: TableView<T> does not display the content of ObservableList<T> objects
body: <p>I have two almost similar custom classes for storing simple String data - they are called "Patient" and "Trace".They differ from eachother only by the number of defined fields. Constructors of both are shown below (with <code>getVariablesNames()</code> static method):</p>
  
  <pre><code>public class Patient {
  
      String patientID;
      String firstName;
      String lastName;
      String gender;
      String dateOfBirth;
      String age;
      String email;
      String phoneNumber;
      String city;
  
      public Patient(String patientID, String firstName, String lastName, String gender, String dateOfBirth, String age, String email, String phoneNumber, String city) {
          this.patientID = patientID;
          this.firstName = firstName;
          this.lastName = lastName;
          this.gender = gender;
          this.dateOfBirth = dateOfBirth;
          this.age = age;
          this.email = email;
          this.phoneNumber = phoneNumber;
          this.city = city;
      }
  
      public static String[] getVariablesNames() {
          Field[] fields = Patient.class.getDeclaredFields();
          String[] variablesNames = new String[fields.length];
          for (int i = 0; i &lt; fields.length; i++) {
              variablesNames[i] = fields[i].getName();
          }
          return variablesNames;
      }
  
      public String getPatientID() {
          return patientID;
      }
  
      public void setPatientID(String value) {
          patientID = value;
      }
  
      public String getFirstName() {
          return firstName;
      }
  
      public void setFirstName(String value) {
          firstName = value;
      }
  
      public String getLastName() {
          return lastName;
      }
  
      public void setLastName(String value) {
          lastName = value;
      }
  
      public String getGender() {
          return gender;
      }
  
      public void setGender(String value) {
          gender = value;
      }
  
      public String getDateOfBirth() {
          return dateOfBirth;
      }
  
      public void setDateOfBirth(String value) {
          dateOfBirth = value;
      }
  
      public String getAge() {
          return age;
      }
  
      public void setAge(String value) {
          age = value;
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String value) {
          email = value;
      }
  
      public String getPhoneNumber() {
          return phoneNumber;
      }
  
      public void setPhoneNumber(String value) {
          phoneNumber = value;
      }
  
      public String getCity() {
          return city;
      }
  
      public void setCity(String value) {
          city = value;
      }
  }
  </code></pre>
  
  <p>And constructor for "Trace" class:</p>
  
  <pre><code>public class Trace {
  
      String action;
      String status;
      String message;
      String time;
  
      public Trace(String action, String status, String message, String time) {
          this.action = action;
          this.status = status;
          this.message = message;
          this.time = time;
      }
  
      public static String[] getVariablesNames() {
          Field[] fields = Trace.class.getDeclaredFields();
          String[] variablesNames = new String[fields.length];
          for (int i = 0; i &lt; fields.length; i++) {
              variablesNames[i] = fields[i].getName();
          }
          return variablesNames;
      }
  
      public void setActionText(String value) {
          action = value;
      }
  
      public String getActionText() {
          return action;
      }
  
      public void setStatusText(String value) {
          status = value;
      }
  
      public String getStatusText() {
          return status;
      }
  
      public void setMessageText(String value) {
          message = value;
      }
  
      public String getMessageText() {
          return message;
      }
  
      public void setTimeText(String value) {
          time = value;
      }
  
      public String getTimeText() {
          return time;
      }
  }
  </code></pre>
  
  <p>I use objects of those classes to populate custom <code>TableView&lt;T&gt;</code> instances, where <code>&lt;T&gt;</code> can be "Patient" or "Trace". The problem I encounter is that "Trace" object values are not displayed in the table, where there are no problems with objects of the "Patient" class. The custom <code>TableView&lt;T&gt;</code> class is shown below:</p>
  
  <pre><code>import javafx.collections.ObservableList;
  import javafx.scene.control.TableColumn;
  import javafx.scene.control.TableView;
  import javafx.scene.control.cell.PropertyValueFactory;
  
  public class TableViewCustom&lt;T&gt; extends TableView&lt;T&gt; {
  
      public TableViewCustom(String[] columnNames, String[] variablesNames, ObservableList&lt;T&gt; data) {
          super();
  
          @SuppressWarnings("unchecked")
          TableColumn&lt;T, String&gt;[] tableColumns = new TableColumn[variablesNames.length];
          for (int i = 0; i &lt; tableColumns.length; i++) {
              tableColumns[i] = new TableColumn&lt;T, String&gt;(columnNames[i]);
              tableColumns[i].setCellValueFactory(new PropertyValueFactory&lt;T, String&gt;(variablesNames[i]));
          }
  
          this.setItems(data);
          this.getColumns().addAll(tableColumns);
  
          this.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
      }
  }
  </code></pre>
  
  <p>And the example implementation of this custom TableView with use of both "Patient" and "Trace" objects:</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.scene.layout.BorderPane;
  import javafx.scene.layout.VBox;
  import javafx.stage.Stage;
  
  public class Demo extends Application {
  
      public Parent createContent() {
  
          /* layout */
          BorderPane layout = new BorderPane();
  
          /* layout -&gt; center */
          VBox tableViewsContainer = new VBox(5);
  
          /* layout -&gt; center -&gt; top */
          String[] patientColumnNames = new String[] {"Patient ID", "First Name", "Last Name", "Gender", "Date Of Birth", "Age", "Email", "Phone Number", "City"};
          String[] patientVariablesNames = Patient.getVariablesNames();
          ObservableList&lt;Patient&gt; patientData = FXCollections.observableArrayList(new Patient("Patient ID", "First Name", "Last Name", "Gender", "Date Of Birth", "Age", "Email", "Phone Number", "City"));
          TableViewCustom&lt;Patient&gt; patientTableView = new TableViewCustom&lt;Patient&gt;(patientColumnNames, patientVariablesNames, patientData);
  
          /* layout -&gt; center -&gt; bottom */
          String[] traceColumnNames = new String[] {"Action", "Status", "Message", "Time"};
          String[] traceVariablesNames = Trace.getVariablesNames();
          ObservableList&lt;Trace&gt; traceData = FXCollections.observableArrayList(new Trace("Action", "Status", "Message", "Time"));
          TableViewCustom&lt;Trace&gt; traceTableView = new TableViewCustom&lt;Trace&gt;(traceColumnNames, traceVariablesNames, traceData);
  
          /* add items to the layout */
          tableViewsContainer.getChildren().addAll(patientTableView, traceTableView);
  
          layout.setCenter(tableViewsContainer);
          return layout;
      }
  
      @Override
      public void start(Stage stage) throws Exception {
          stage.setScene(new Scene(createContent()));
          stage.setWidth(700);
          stage.setHeight(400);
          stage.show();
      }
  
      public static void main(String args[]) {
          launch(args);
      }
  }
  </code></pre>
  
  <p>The result of Demo.java app is shown below:</p>
  
  <p><img src="https://i.stack.imgur.com/0OExX.jpg" alt="enter image description here"></p>
  
  <p>PS I'm not getting any errors.</p>