0

I have been asked if it's possible to select text in JavaFX 8 from labels? Since we use labels in headers, tables, etc for display of read only text, this becomes an issue for our users when they wish to copy and paste that information.

I was unable to find anything similar on this question.

i.e.

@FXML
private Label headerLabel;

Is there a way to allow that headerLabel to have it's text selected and copied with the mouse?

Is this possible? If not, any suggestions?

Thanks

purring pigeon
  • 4,141
  • 5
  • 35
  • 68
  • 3
    So the only way to do this is to change all the label objects to textfields with a label type style? Seems like an unfortunate hack... – purring pigeon Mar 01 '16 at 19:41
  • Call it what you want, but it is what it is. Your other option is to use an embedded WebView, which also allows text selection of label-like things, however that approach can be viewed similarly as a hack if so inclined. – jewelsea Mar 01 '16 at 20:12
  • Thanks - am going the way you recommend. – purring pigeon Mar 01 '16 at 22:47

0 Answers0