Java – how to make textflow optional

I made a textflow because I need to use multiple font poses (I have set the specific "text" to italic or normal) Once I display textflow, it is not selectable / replicable What I need is that textflow can be selected once it is displayed in the scene, so it can be copied / pasted

Example of text with font post (only one example):

Text volumeText = new Text(volume.getText());
volumeText.setFill(Color.WHITE); 
volumeText.setFont(Font.font("arial",FontPosture.ITALIC,13));
TextFlow reference = new TextFlow(
                         lastNameText,miscelanous1,firstNameText,miscelanous2);
reference.setLayoutX(115);
reference.setLayoutY(480);
reference.setMaxWidth(500);
control.getChildren().add(reference);

Solution

Text and textflow in JavaFX are not optional

There is a problem with this: text should have API for selecting group of characters based on their position similar to the DOM's range

Until the problem is solved, your best choice is to use third-party controls such as richtextfx

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>