Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Copy paste operations in disabled textfields

 
vasu kasukurthi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
make them uneditable, which allows copy
override paste() to change editable to true, perform paste(), then editable back to false
 
vasu kasukurthi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic