• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JavaFXML. Two columns layout. First column with fixed width.

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm starting to learn JavaFX and I have some questions. I play with JavaFX Scene Builder 2.0 and root component has this settings: maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity". I can't find what value -Infinity uses for?

And I want make two columns layout with fixed width of the first column and the second column with width of remaing space. So I use HBox container, because there is automatic full height of inside containers. I don't know what is the right settings for second column to fill remaining width. Can you please advise me?



Have a nice day :-)!
 
Petra Cervinkova
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found solution, for second AnchorPane set HBox.hgrow="ALWAYS".

Still I don't know purpose of -Infinity value.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since this is related to JavaFX, I've moved the thread to the appropriate section.
 
Rancher
Posts: 387
30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See this code from the Region class.

Hopefully it explains what the NEGATIVE_INFINITY value means in this context => Instruct the control to use the preferred size for a given size constraint, such as minWidth or maxHeight.
FXML isn't really built to be human readable, though it is in most cases, but some of the values such as -Infinity are a little weird to see rather than a more easily understandable constant name such as USE_PREF_SIZE, even though they mean exactly the same thing.



Translating some of the FXML to english:

HBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="555.0"

Means:

Define a HBox of preferred size 555x400 with the maxHeight and maxWidth and minHeight and minWidth all set to the preferred height and width.
So essentially you have defined a container which is 555x400 in size and will always remain that size, as the max/min constraints you set all match the preferred size.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic