JDK-8091714 : [TextArea] add option about resizing to fit content.
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 7u6
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2012-04-19
  • Updated: 2023-07-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
TextArea knows at each time the size of content, so scrollBars appear at the moment, when content doesn't fit in the visible area. At that moment instead of showing scrollbar can be done a decision to  resize textArea. It would be nice to have an option which allows to make a decision: show scrollBars, wrap text, or to resize accordingly.

It came from : I thought, what if try to create a mind map like this one:
http://go.comapping.com/comapping.html#trial=true
You can see there some text areas (which in javafx can be better done with webView), but I think, that possibility to fit a content will be suitable for TextArea too.

Comments
I, too, would love to have an official solution to this problem.
14-01-2015

Just managed to devise my own hacky solution: https://bitbucket.org/walczak_it/prodoko-base/src/HEAD/prodoko-fx/src/main/java/com/prodoko/fx/control/ExpandingTextArea.java?at=master however it wont handle any text area CSS/skin changes.
02-01-2014

+1. This seams to be desirable feature: http://stackoverflow.com/questions/15593287/binding-textarea-height-to-its-content http://stackoverflow.com/questions/18588765/how-can-i-make-a-textarea-stretch-to-fill-the-content-expanding-the-parent-in-t Personally I'm developing a system in which I would apply it right away. Someone even tried to hack the control to accomplish this: https://code.google.com/p/javafx-demos/source/browse/trunk/javafx-demos/src/main/java/com/ezest/javafx/components/freetextfield/ScrollFreeTextArea.java however I was unable to make this code work.
02-01-2014