aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "Resizing HTMLEditor in JavaFX" Watch "Resizing HTMLEditor in JavaFX" New topic
Author

Resizing HTMLEditor in JavaFX

Dusan Vajda
Greenhorn

Joined: Jun 07, 2014
Posts: 2
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]



Dusan
John Damien Smith
Ranch Hand

Joined: Jan 26, 2012
Posts: 145
    
    9
I think your answer is in:
http://stackoverflow.com/questions/11213079/javafx-2-borderpane-use-full-space


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: https://javafx-jira.kenai.com and in the bug link back to this thread for context.
Dusan Vajda
Greenhorn

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

thanks, this workaround solved my problem ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Resizing HTMLEditor in JavaFX