Selectable JLabel, without just a JTextfield

可紊 提交于 2019-12-25 08:47:43

问题


I need to be able to select the text in a JLabel. Ive read some guides on the net that talk about using a JTextfield to simulate a JLabel, however this is no use to me as I my JLabel will span multiple lines. So any ideas on how to do this or if it's even possible?


回答1:


You can use a non-editable JTextArea which allows for multiple lines and selectable text, and visually looks the same as a JLabel.

I do not think it is possible with a JLabel (at least I do not know how)



来源:https://stackoverflow.com/questions/9757914/selectable-jlabel-without-just-a-jtextfield

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!