Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

How can I make a window responsive to resizing in Javafx?

+14 votes
I have windows with things like buttons in them. Whenever I resize the window, the buttons can get left out. How can I make it so that the buttons and other items stay in the window when resizing?
asked Oct 9, 2016 in CSC 285 (F16) by Antonio Rosas (100 points)
I don't know the answer to this one myself -- maybe someone else working with JavaFX does?   Or maybe someone with expert googling skills can find a tutorial related to this...

2 Answers

+4 votes
We actually have the same problem that: when we maximize the window, all the components inside still keep the original size.

We're trying to fix it by using the one more Listener class which can change the height and width of the scene when we click on the maximize button.
answered Oct 24, 2016 by Tan Nguyen (100 points)
+2 votes

Have you considered just making it so you can't resize the program?

stage.setResizable(false);

Put that simple line in a suitable place (after editing it if needed, of course), and it'll make it so the user can't resize the program. That's what we've chosen to do in Team Downy, and we don't feel that it harms the user experience.

answered Oct 25, 2016 by Kyle McCaw (100 points)
...