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

  • Home
  • SEARCH
  • 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 8859599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:06:27+00:00 2026-06-14T15:06:27+00:00

I have a ploblem with resizing of ImageView in StackPane: If StackPane is root

  • 0

I have a ploblem with resizing of ImageView in StackPane:
If StackPane is root container and I bind image’s height and width to StackPane, everything is fine.

<StackPane id="StackPane" fx:id="stack" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: lightgreen;" styleClass="mainFxmlClass" xmlns:fx="http://javafx.com/fxml" fx:controller="javafxapplication8.FXMLController">
  <children>
    <ImageView fx:id="image" fitHeight="100.0" fitWidth="300.0" pickOnBounds="true" preserveRatio="true" />
  </children>
  <stylesheets>
    <URL value="@fxml.css" />
  </stylesheets>
</StackPane>

But if I place such stack pane in, for example, grid, than image doesnt resize properly.
As I read, the problem that ImageView is non-Resizable. Is there any ways to make it resizable? Or could you give some advise how to resize ImageView?

  • 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-14T15:06:29+00:00Added an answer on June 14, 2026 at 3:06 pm

    It sounds like you are trying to create a background image for the StackPane. In which case applying the image via CSS may be a better route to use than an ImageView.

    .stack-pane {
      -fx-background-image: url("flower.png");
      -fx-background-size: cover;
    }
    

    See the background images section of the Region specification in the JavaFX CSS reference guide.

    Making ImageView itself resizable is an unresolved major issue. The issue links to code for a simple workaround – a resizable ImagePane wrapping an Image to fill the resizable pane.

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

Sidebar

Related Questions

I have an ImageView, it shows an image from resource. ImageView's widht is fixed
Hello I have problem with my resizing and uploading img to server. Everything was
I have some strange problem with PIL not resizing the image. from PIL import
We have a situation in our project when resizing a container. It seems to
I have problem with UIWebView delay when the load image from url. In my
I have a sample project that uses the metrics from notifications for resizing the
I have a little bit problem with resizing Listview control. I intend to make
i have a problem while uploading and resizing images in a loop. can anyone
I have one problem with my jPanel. I have a button which PNG image
i have a transparent JFrame AWTUtilities.setWindowOpaque(this, false); I have a problem when resizing the

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.