This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resizing HTMLEditor in JavaFX

 
Dusan Vajda
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
screenshot1.png
[Thumbnail for screenshot1.png]
screenshot2.png
[Thumbnail for screenshot2.png]
 
John Damien Smith
Ranch Hand
Posts: 296
14
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John,

thanks, this workaround solved my problem ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic