I hava 3 tabs in a TabPane that each one has a text area with different texts and different length. I want to autosize text area according to it's length in each tab. I don't understand what should I do ? using scene builder ? css ?javaFX methods ? Thank's in Advance ...
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I think you are asking that the text areas grow or shrink according to the text that is displayed in them?
If so, see if this code helps:
If you want to make this reusable, then you could consider subclassing
TextArea
. (In general, I dislike subclassing control classes.) The tricky part here would be to execute the code that makes theTextArea
expand once it has been added to a live scene graph (this is necessary for the lookup to work). One way to do this (which is a bit of a hack, imho) is to use anAnimationTimer
to do the lookup, which you can stop once the lookup is successful. I mocked this up here.