I'd like to implement a maximize feature (i.e. press a button and everything—all the buttons, text, the scene—gets bigger by a defined amount). To do this, I used this method recommended on another thread to set the size of my scene equal to the screen size:
sw = stage.getWidth();
sh = stage.getHeight();
Rectangle2D screen = Screen.getPrimary().getVisualBounds();
Scale scale = new Scale(screen.getWidth()/sw, screen.getHeight()/sh, 0, 0);
scene.getRoot().getTransforms().setAll(scale);
When I do this, however, all the text in my program gets fuzzy.
Original:
Resized:
If I go all out and transform everything by a factor of 2, though, it all appears to scale nicely:
Double Sized
Why should expanding by one factor transform components in a different way than another? Is there a way to fix this or a better way to resize an entire program?