File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JavaFX and the fly likes Resizing HTMLEditor in JavaFX Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "Resizing HTMLEditor in JavaFX" Watch "Resizing HTMLEditor in JavaFX" New topic

Resizing HTMLEditor in JavaFX

Dusan Vajda

Joined: Jun 07, 2014
Posts: 3
Hello codeboys and codegirls,

I'm trying to create a scene with a HTMLEditor (JavaFX example code below). I have given the HTMLEditor green background, and the HTML text inside has red background (to better see the problem).

When the application starts everything looks fine as I see only the red colour (screenshot1), but as the window gets bigger, the "editable area" inside doesn't seem to care and will not go beyond 600 pixels in height (screenshot2). I can't find anything to make it better, so I thought that you could help me ...

Thanks in advance

[Thumbnail for screenshot1.png]

[Thumbnail for screenshot2.png]

John Damien Smith
Ranch Hand

Joined: Jan 26, 2012
Posts: 227
I think your answer is in:

Internally the WebPane is implemented as a GridPane containing the Toolbar and an editable WebView. By default, WebView has a preferred size of 800x600. The HtmlEditor control does not set the GridPane constraints for the WebView to allow it to be sized past it's preferred size.

To work around this, you can lookup the WebView via a css lookup after it has been added to an active Scene and adjust the GridPane constraints manually. Here is some code to do that:

It's actually a bug in the HtmlEditor implementation (I believe), so you could file it at: and in the bug link back to this thread for context.
Dusan Vajda

Joined: Jun 07, 2014
Posts: 3
Hi John,

thanks, this workaround solved my problem ...
I agree. Here's the link:
subject: Resizing HTMLEditor in JavaFX
jQuery in Action, 3rd edition