Copy text from a disabled JTextField

Is it possible to allow the user to copy text from a disabled JTextField? At the moment, if I have a text field that is disabled, the user cannot select the text to copy and paste into another application.

+6
java swing jtextfield
source share
2 answers

Make the text field not editable, then you can use the mouse to select the text.

You can also change the font color to make it look disabled.

+12
source share

Camickr's recommendations are true, but as an alternative, you can add a right-click menu item with a copy action.

+3
source share

All Articles