Issue
When I'm building the layout with IntelliJ using FXML, the layout can be viewed by using the SceneBuilder in another tab.
src="https://i.stack.imgur.com/8UUo3.png" alt="enter image description here" />
Is there a way to make it so the FXML code and scenebuilder can both be viewed at the sametime so I don't have to keep alternating back and forth between the two panels Text and SceneBuilder?
In Android studio the equivalent of the SceneBuilder would be the Preview which is located all the way on the right side of the IDE.
How can I move the SceneBuilder all the way to the right like so? Or is there something else that is used to preview the layout that I'm unaware of?
Solution
To display, within Intellij Idea, both the fxml source view and the SceneBuilder view at the same time, for the same FXML file:
- Double click the FXML file in the Project Pane to open it.
- Right-click on the tab header of the FXML file.
- Choose "Split Right" or "Split Down" depending on your preference.
- You will now have two tabs for the same FXML file, both showing the FXML source.
- In your second tab for the FXML file, click on "Scene Builder" in the bottom tab.
- You will now have your source FXML and the Scene Builder FXML for the same file side by side.
- (optional extra) If you want a source view or Scene Builder view in a new window rather than a new tab, right-click the related tab header and choose "Move to tab to New Window".
Unrelated aside
For me, on a Mac OS (10.15), Scene Builder inside IntelliJ (2021.2 UE) shows garbled fonts throughout the application making it unusable (the stand-alone SceneBuilder app from Gluon does not have this issue). Hopefully, it works better for you.
- Intellij bug tracker link for the unusable fonts in SceneBuilder on Mac when embedded in Idea IDEA-266524.
So, this is a known issue which Intellij will hopefully address in a future release.
Answered By - jewelsea
Answer Checked By - Terry (JavaFixing Volunteer)