This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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
 
Don't get me started about those stupid light bulbs.
 
subject: Copy paste operations in disabled textfields