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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:59:24+00:00 2026-06-17T00:59:24+00:00

Coding a GUI in a Java project I’ve encountered a problem with JavaFX. I’ve

  • 0

Coding a GUI in a Java project I’ve encountered a problem with JavaFX.
I’ve not found any soulutions for my specific problem, so here I am:)

Is it possible to let a JavaFX scene be resizeable by the user and at the same time have it not resized by child nodes, that are bigger, than the window?

Here is some sample code:

@Override
public void startGUI(int width, int height) {
    this.main = new MainWindow(this, this.logic);
    this.scene = new Scene(this.main.getRoot());
    this.main.setScene(this.scene);
    this.primaryStage.setScene(this.scene);
    this.primaryStage.setMinHeight(height);
    this.primaryStage.setMinWidth(width);
}

The ‘MainWindow’ has got a childnode, that can be very big (>1024×768).
I want the window not to be resized by this node, but at the same time, the user should be able to resize the window by dragging its borders.

  • 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-17T00:59:26+00:00Added an answer on June 17, 2026 at 12:59 am

    Use a Scene constructor which specifies initial size constraints.

    For example:

    Scene scene = new Scene(root, 600, 400);
    

    That way the initial size of the Scene will be taken from these constraints rather than calculated from the preferred size of the root node.

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

Sidebar

Related Questions

Possible Duplicate: Java, GUI builder or hand coding? I have been making GUI hand-coded
I'm creating a java command line project, with no GUI. The project uses any
I am working on a java gui application hard coding without any netbeans help.
I'm trying to create a GUI using Java by hand-coding it (without using GUI
After coding and testing a Java application (lets say with Eclipse, but not necessarily)
Using Sql Express Management Studio 2008 GUI (not with coding), how can I make
I'm looking for patterns that concern coding parts of a GUI. Not as global
I'll be cranking out my first serious GUI in Java here over the next
I'm trying to learn how to do the GUI stuff in java with coding
Here's a very specific coding question: I've recently been asked to maintain some old-ish

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.