Issue
I've been working with Swing and SpringLayout for a while now and I want to know if JavaFX has equvalent of Swing SpringLayout, as I plan on swapping to JavaFX soon for my personal projects.
Solution
JavaFX is not Swing. JavaFX does not have the concept of a LayoutManager
like Swing does. In Swing you assign a layout manager to a JPanel
, for example BorderLayout
, but in JavaFX you use a BorderPane
which is a container that uses a specific layout. I don't know whether JavaFX has a container that lays out its components like SpringLayout
does but I doubt it. Possibly, GridPane may be appropriate. In any case, the tutorial linked to in the other answer may help you discover an appropriate container.
Remember, you can't write JavaFX the same way you write Swing. You need to adapt to the JavaFX way of doing things. For example, JavaFX uses "bindings" while Swing uses "listeners".
Answered By - Abra