Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaFX - Included fxml does increase in size when placed in borderpane center  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to include an additional fxml in a main fxml, border pane center. When I do this, the fxml gets included and shows in the center, but the fxml does not occupy the full width and height of the main fxml window.

In the SceneBuilder, if I add the TableView in the center of the borderpane, it acts as it should. Only when I include the fxml via code it does not.

Please help, what am I missing? Any help will be appreciated

This is what I need:


This is what I get:


Main FXML:



FXML I want to add:

 
Rancher
Posts: 279
6
Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is that you're using a borderpane, he leaves room on the sides for the expected other panes. If thhis is the only content you want to display, use a anchorpane
 
Ranch Hand
Posts: 120
1
C++ Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think that normally borderpane will hide the empty parts but since its inside of a tabbedPane thats probably why it breaks. The titledPane also acts weird when you put things in it, it shows a big gap and it disrespects the grow properties set on the child containers. You can fix some of this weirdness with css, but in your case its easier to just use a VBox instead of the borderpane.
 
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!