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 8194345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:47:32+00:00 2026-06-07T04:47:32+00:00

I am looking for a way to say set a maxWidth size to 80%

  • 0

I am looking for a way to say set a maxWidth size to 80% in FXML.

Much like in web development.

<VBox fx:id="testVB" prefWidth="600">

But this does not:
<VBox fx:id="testVB" prefWidth="80%">

I know that in Straight JavaFX2 non-fxml you can create insets? What is the best way to do this outside of code in FMXL?

Thanks!

Riley

  • 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-07T04:47:34+00:00Added an answer on June 7, 2026 at 4:47 am

    I’m not sure you can. You need to use the GridPane layout component. In this component, you can specify rows and columns constraints, and in these constraints you can specify a width as a percentage. For example:

    <GridPane>
        <children>
            <TitledPane text="testGridPane" GridPane.columnIndex="0" GridPane.rowIndex="0" />
        </children>
        <columnConstraints>
            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="80.0" prefWidth="100.0" />
            <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" percentWidth="20.0" prefWidth="100.0" />
        </columnConstraints>
        <rowConstraints>
            <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
        </rowConstraints>
    </GridPane>
    

    This code defines a GridPane with a first column with a width of 80%. The TitledPane is set in the first cell of the first column of this GridPane, and can (because you need to be sure that the width constraints of the TitledPane match your needs) occupy 80% of the width of the GridPane.

    Please note that I removed all information not relevant to your question. By the way, Oracle’s Scene Builder tool is very useful to define complex FXML layout.

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

Sidebar

Related Questions

I'm looking for way to create list view as like in IOS with pinned
I am looking for an automated way to iterate over all ObjectQueries and set
I'm looking for a way to achieve the following in MVC 3. Let's say
I'm looking for a way to use the ouput of a command (say command1)
I am looking for a standards-compliant way to store multi-language content for a Web
I'm looking for the best way to do the following in C#. Say I
I'm looking at taking a set of objects, let's say there's 3 objects alive
I'm looking a way to enable IP logging with log4net in ASP.NET. I found
I'm looking for way to write Javascript programs / scripts on desktop, not inside
I'm looking a way to build conditional assignments in bash: In Java it looks

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.