GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Copy paste operations in disabled textfields Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Copy paste operations in disabled textfields" Watch "Copy paste operations in disabled textfields" New topic
Author

Copy paste operations in disabled textfields

vasu kasukurthi
Greenhorn

Joined: Dec 14, 2009
Posts: 9
i have following code.
JTextField jtfCol1 = new JTextField(5);
JTextField jtfCol2 = new JTextField(5);
---
---
jtfCol1 .setEnabled(false); jtfCol2 .setEnabled(false);

i need to perform copy and paste operations on these fields, But they are disabled. I tried with setEditable(false); also but it is not working.

Can any one help me.

Thanks in advance.


Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
make them uneditable, which allows copy
override paste() to change editable to true, perform paste(), then editable back to false
vasu kasukurthi
Greenhorn

Joined: Dec 14, 2009
Posts: 9
thank you
 
GeeCON Prague 2014
 
subject: Copy paste operations in disabled textfields