Let's assume there is an unknown text with some styles.
Now, I need
- to create text area (InlineCssTextArea) with fixed width (for example, 500 pixels)
- to add text to it with styles
- to find whole document height
- to make text area height equal to document height
- to add text area to scene to show whole document without scrollbars.
As it is seen the problem is that I need whole document height when I only add text area to scene. I tried this code:
var messageArea = new InlineCssTextArea();
var scrollPane = new VirtualizedScrollPane(messageArea);
messageArea.totalHeightEstimateProperty().addListener((ov, oldV, newV) -> scrollPane.setMinHeight((double) newV));
This code works, but the problem is that when messageArea becomes visible it has one height and later its height is changed and user sees flickering. I tried to add
messageArea.setAutoHeight(true);
messageArea.applyCss();
messageArea.requestLayout();
But it didn't help. Could anyone say how to do it if it is possible?
Let's assume there is an unknown text with some styles.
Now, I need
As it is seen the problem is that I need whole document height when I only add text area to scene. I tried this code:
This code works, but the problem is that when messageArea becomes visible it has one height and later its height is changed and user sees
flickering. I tried to addBut it didn't help. Could anyone say how to do it if it is possible?