0
votes

I'm working on simple UI for database information with JavaFX. When using TableView no horizontal scroll bar appear, but it is expected. In the past I have never faced such problem.

enter image description here

As you can see on the image sample C2 column is truncated.

My software versions:

  • Linux computer 4.18.0-0.bpo.1-amd64 #1 SMP Debian 4.18.6-1~bpo9+1 (2018-09-13) x86_64 GNU/Linux

  • java version "1.8.0_201"

  • Java(TM) SE Runtime Environment (build 1.8.0_201-b09)

  • Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

Code:

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>


<TableView maxHeight="-1.0" maxWidth="-1.0" tableMenuButtonVisible="true" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1">
  <columns>
    <TableColumn maxWidth="400" minWidth="300.0" prefWidth="-1.0" text="C1" />
    <TableColumn maxWidth="400" minWidth="300.0" prefWidth="-1.0" text="C2" />
  </columns>
</TableView>
1
hmm .. why do expect a scrollbar without data? arguably, there is nothing to scroll .. - kleopatra
I expect that during design I see elements the way they should work. But the thing is that even there are three columns total wider then tableview the is no scroll - javadev
if you think it's a bug, report it (not here ;) - as I already stated, I personally don't think it is: there isn't any need to scroll a table if there is no content - anyway, still don't understand: what is your question? What do you expect? If the sum of the minwidths is greater than the window width, they are truncated ... what else should happen? - kleopatra
Yes exactly. And in this case scroll should appear. The question is why it's not happening? How to make scroll appear? - javadev
You is right. After adding data scroll appear. Thank you! But it is really strange cause during design it would be not convenient. - javadev

1 Answers

0
votes

The scroll bar in table view appear only during execution when data is added. Thanks to kleopatra.