0

I have an issue trying to populate the table view from my SQLite DB. When i try to link my fx id's with my controller i get the error:

Cannot set javafx.Scene.control.TableColumn to field 'col_date'

Controller:

@FXML public TableView QDBView;
@FXML public TableColumn col_date;
@FXML public TableColumn col_opid;

FXML:

    <TableView fx:id="QDBView" layoutY="27.0" prefHeight="740.0" prefWidth="1100.0">
        <columns>
          <TableColumn fx:id="col_date" prefWidth="75.0" text="Date" />
          <TableColumn fx:id="col_opid" prefWidth="75.0" text="UID" />
        </columns>
      </TableView>
KingKeyy
  • 59
  • 7
  • Without a [mcve] we can't give definitive answers (see [ask]). One thing to check is your imports; make sure you're using JavaFX's `TableColumn` and not Swing's. Also, make sure to specify the generic parameters ([don't use raw types](https://stackoverflow.com/questions/2770321)). – Slaw Jan 29 '19 at 07:08
  • Have you created your own `TableColumn` class or did you just type in the error message instead of copy&pasting it? `javafx.scene` has a lowercase `s` unlike your error message. Furthermore the complete stacktrace should reveal the issue. It should be added to the question. – fabian Jan 29 '19 at 09:43
  • Hello, the issue was as @fabian mentioned, i failed to generate a constructor in my TableColumn and from there it all went down hill :). Thank you. – KingKeyy Jan 29 '19 at 10:40

0 Answers0