Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8825627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:55:32+00:00 2026-06-14T06:55:32+00:00

Context: I am building a JavaFX application with java1.7.0_07 and Jython. My application has

  • 0

Context: I am building a JavaFX application with java1.7.0_07 and Jython. My application has a ScrollPane that contains a GridPane that contains a variable number of GridPanes. My application discards and rebuilds the innermost GridPanes each time a TreeView selection changes.

Problem: When I select something in the TreeView, the innermost GridPanes are huge, pushing all but the first innermost GridPane outside of the viewable area of the the ScrollPane. Regardless, the ScrollPane does not display scroll bars, giving the impression that there is only one innermost GridPane object. Manually resizing the window that contains the ScrollPane ‘fixes’ things! How can I get the innermost GridPanes to be that size from the moment that I add them?

Of course, the first thing I tried was to call requestLayout() on the outer GridPane from the Jython interpreter, and this works just as well as resizing the containing window. This is also how I discovered that the innermost GridPanes were huge—I called getBoundsInParent() on each of the innermost GridPanes.

However, inside of my ChangeListener.changed() implementation, everything is different. Calling requestLayout() does not seem to do anything. Moreover, the bounds of each of my innermost GridPanes is [0,0,0,0]! It looks like there is something asynchronous going on here, but I am new to JavaFX and I do not know what.

Update: Getting closer! Each of the innermost GridPanes contains a Label, and I am calling setWrapText(true) on each of the Labels. If I do not enable wrapping on the Labels, the layout behaves correctly! If I call setPrefHeight(40) on each of the Labels, the layout behaves correctly even with text wrapping enabled, but I really dislike the idea of trying to guess an appropriate preferred height to assign to each of my Labels. I just want the Labels to start with the bounds that they assume when I ‘wiggle’ the containing window. But how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:55:33+00:00Added an answer on June 14, 2026 at 6:55 am

    Each of the innermost GridPane objects had a ColumnConstraints object with a percentWidth of 100. Removing the code that added this (unnecessary) ColumnConstraints object to the innermost GridPane objects fixed the layout misbehavior that appeared only when the contained Label objects had wrapText set to true.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me provide some context: I am building a tabbed application that allows a
# Explaining the context puts I am learning Rails, building a simple forum application.
# Explaining the context puts I am learning Rails, building a simple forum application.
Context: I am learning Java, and am building a web application as a study(learn
Context: I'm building a little site that reads an rss feed, and updates/checks the
Context I'm building a persistence layer to abstract different types of databases that I'll
My end goal is simple. I am building a website that has three components:
context: I'm building a favouriting system that uses html localstorage API (with a php
The business context of the use case is that we are building a backend
I'm building a MVC 3 application and use Entity Framework 4.3 code-first. My context

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.