I am currently involved in the migration of the Swing application preferences panel to JavaFX. The application first reads what needs to be built from the xml file. The application then uses this information to create and add a large number of JComponents and related JLabels to the panel, along with some delimiters, as follows:
layout = new FormLayout(description, ""); builder = new DefaultFormBuilder(bottomLayout); // In some loop propertyControlImpl.layout(builder); public void layout(final DefaultFormBuilder builder) { final JLabel label = builder.append(TextUtils.getOptionalText(getLabel()), component); // set the text property of label, etc } public void layout(final DefaultFormBuilder builder) { builder.appendSeparator(TextUtils.getOptionalText(getLabel())); }
What is the best approach to convert this to JavaFX? Are there any open source JavaFX libraries that have been made for this? If not, I plan to use a combination of stacked TitlePanes and hboxes to host various controls (components).
Here is the layout (created using JavaFX SceneBuilder) of what I'm trying to create. I still haven't aligned everything, but I would like all the labels to be justified and occupy the space of the longest label. All the components that should be left to the right of the shortcuts (just like DefaultFormBuilder does):

java layout forms swing javafx
kshikama
source share