I’m new to JavaFX and I’m writing a simple login application that I would like to launch in my web browser.
How could I get the web browsers width and height? Is there some object for this purpose or a method I would like to be able to resize the application whenever the browser’s size is changed.
Thank you very much for your answers and help. 🙂
I answered a similar question to this in a Oracle forum post. I’ll reproduce the answer here.
The answer is to set a percentage height and width on the embedded application.
Yes, see the Ensemble sample application
Ensemble source code in the JavaFX samples package.
The deployment toolkit currently cannot produce the correct html file for you (see RT-19247 “javafxpackager -deploy does not accept percentage heights and widths”).
However, editing the html file to make the required changes after the deployment tool has run is trivial and, if you look at the ensemble ant build script, you can see that the changes can also be automated within ant.
Here is an excerpt from the Ensemble sample app which demonstrates how to accomplish this.