Search code examples
javafxwysiwygfxmldesign-time

JavaFX design time sizes


Is it possible in JavaFX FXML to define design time sizes (width, height) of scene graph nodes? It would be very convenient for the designer to view what he/she doing in the WYSIWYG tool.

WPF (Microsoft Silverlight) for example has Design-Time Attributes feature for that.

Maybe anyone know any workarounds for this topic?


Solution

  • JavaFX does not have design time sizes. I had never heard of the concept before and find it a little weird. I guess it has some benefit if you find it convenient in WPF.

    You could could create a feature request in the JavaFX issue tracker if you like. Probably create it against SceneBuilder (known as the design tool in the issue tracker).

    Perhaps the closest thing to design time attributes is setting a preferred size of an element. At runtime the element may have a different size than the preferred size. It's actual size may range between its minimum size and maximum size depending upon the layout logic and layout constraints configured for it in its parent container.