Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 936
digiarnie Avatar asked Feb 01 '11 02:02

digiarnie


Video Answer


2 Answers

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.

like image 120
camickr Avatar answered Sep 20 '22 10:09

camickr


Camickr's suggestions are the right on, but alternatively you could add a right click menu option with a copy action.

like image 31
jzd Avatar answered Sep 22 '22 10:09

jzd