2

I'm using javaFX and My problem is I want to keep grid lines traced even if there is no item on the TableView as shown on this image. The result i want but I get no success the TableView still display the placeholder if it is empty as shown: What I get

bougsid
  • 94
  • 1
  • 4
  • Not tested, but try `tableView.setPlaceholder(null);`. – James_D Mar 09 '16 at 14:27
  • 1
    Possible duplicate of [How can I bypass the JavaFX's TableView "placeholder"?](http://stackoverflow.com/questions/16992631/how-can-i-bypass-the-javafxs-tableview-placeholder) – Modus Tollens Mar 09 '16 at 14:51
  • 1
    @James_D Unfortunately setting the placeholder to `null` won't help. `TableViewSkinBase#updatePlaceholderRegionVisibility` sets the placeholder to standard values if it is `null`. – Modus Tollens Mar 09 '16 at 14:55
  • As mentioned on the duplicate question, there exists an enhancement request for this problem: [Don't force me to use the default 'placeholder' in an empty TableView](https://bugs.openjdk.java.net/browse/JDK-8090949). – Modus Tollens Mar 09 '16 at 15:02

1 Answers1

1

A work around to achieve the wanted result :

  • Add an empty row to the table
  • Add the first element
  • Remove the empty row
Taoufik J
  • 700
  • 1
  • 9
  • 26