Is it possible to allow a user to copy text from within a disabled JTextField? At the moment if I have a text field that is disabled, the user is unable to select the text to copy and paste into another app.
Asked
Active
Viewed 3,441 times
2 Answers
13
Make the text field non editable, then you can still use the mouse to select text.
You can also change the font color to make it look disabled.

camickr
- 321,443
- 19
- 166
- 288
-
1JTextComponent has a getDisabledTextColor() method you can use. – Joshua Goldberg Feb 06 '15 at 18:17
3
Camickr's suggestions are the right on, but alternatively you could add a right click menu option with a copy action.

jzd
- 23,473
- 9
- 54
- 76