Search code examples
javaswingjtextfield

Copy text from a disabled JTextField


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.


Solution

  • 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.