"/>
  简体   繁体   中英

JavaFX: Is there any way to show images in a TextArea

I want to show images in a TextArea , just like a div with contentEditable in HTML.
I do NOT wan't a background image.
For example: HTML中具有<code> contentEditable </ code>的<code> div </ code>

The only possbility I see is by adding it as Background of the TextArea. For example via css with fx-background-image:url

try to add the textarea and the image in a same group like :

Textarea text = new Textarea();
ImageView img= new ImageView ();

Group group = new Group();

group.getChildren().add(img);
group.getChildren().add(text);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM