问题
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