JavaFX tableview resize to fit window

后端 未结 2 1603
终归单人心
终归单人心 2021-02-19 03:24

I am just trying out JavaFX and am forcing my way into it because it is suppose to be the future. I am trying to create a table with 4 columns. The columns AND THE TABLE shoul

2条回答
  •  执笔经年
    2021-02-19 04:12

    After some homework, we came up with some qualifying information on FXML containers. Pretty much for the same reason given above by @user3403469. In the Scene Builder, there's a long list of 'containers'. Imho, only these 9 elements and Pane qualify as layout container, as they inherit from

    ... parent for all Pane classes. While both, Pane and Control inherit from Region only the Pane child-classes have layout properties.

    * 
    * 
    * 
    * 
    * 
    * 
    * 
    * 
    *  
    

    You can consider that Control child-classes more or less inherit Events and actions. Layout like things need to come from the encapsulating region, and the only thing with layout elements available to wrap a 'Control' is-a 'Pane'.

    • javafx.scene.layout.Pane

    These FXML elements would be the bespoke 'layout managers' described in the @jewelsea's answer and elsewhere.

    I guess 'Control' containers are still containers in FXML. It seems that they need to be 'inside' a panel to do good ;-)

    Corrections and comment welcome.

    related:

    • Percent width for TableColumn in JavaFX 2.x TableView
      • There seems to be a lot of code. My idea of dynamic resizing is a Zero-tolerance for code to do scaling and resize. Gee we left that behind in Windows 1.3 didn't we?
    • where is the: FXML Specification?
    • Reference and Guidelines for Dynamic Layout using JavaFX

提交回复
热议问题