Add hyperlink inside a textarea in JavaFX -
i trying add hyperlink (which open text file onclick) inside textarea in javafx. far have written code below:
hyperlink link = new hyperlink(); link.settext("data sheet"); link.setonaction(new eventhandler<actionevent>() { @override public void handle(actionevent e) { try { java.awt.desktop.getdesktop().browse( java.net.uri.create("my text file")); } catch (ioexception e1) { e1.printstacktrace(); } } }); mytxtarea.appendtext("please cleck here "+link); this code not working. appendtext not working.please help.
you cannot place hyperlink in textarea.
a textarea editing text, not displaying hyperlinks.
potential alternate solutions
- htmleditor - if preload htmleditor text contains hyperlink, htmleditor should display hyperlink ok, though user won't able edit hyperlink htmleditor doesn't provide link editing capability.
- richtextfx - third party javafx control editing syntax highlighted text, don't know if provides link editing functionality or not.
- textflow - inbuilt control allows read-only display mixes javafx nodes such text , hyperlinks.
- webview embedded third party javascript based editor - there source many javascript based editors available on web capable of inline display , editing of hyperlinks, use 1 of these editors embedded in javafx webview component.
- javafx based markdown implementation - have linked 1 such implementation, there others available on web if google them.
Comments
Post a Comment