Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to handle cut/copy/paste events on TextField

Posted on 2004-10-13
6
Medium Priority
?
475 Views
Last Modified: 2008-03-04
Hello All,

How to handle cut/copy/paste events on TextField or JTextField??

Regards
Sudhakar
0
Comment
Question by:sudhakar_koundinya
  • 3
  • 2
6 Comments
 
LVL 37

Assisted Solution

by:zzynx
zzynx earned 300 total points
ID: 12297294
add a DocumentListener to the document of the JTextField.
0
 
LVL 37

Accepted Solution

by:
zzynx earned 300 total points
ID: 12297314
yourTextField.getDocument().addDocumentListener( ... );

and your listener has:

- void changedUpdate(DocumentEvent e) : Gives notification that an attribute or set of attributes changed          (=replaced)
- void insertUpdate(DocumentEvent e) : Gives notification that there was an insert into the document                (=paste or simple typing)
- void removeUpdate(DocumentEvent e) : Gives notification that a portion of the document has been removed   (=Cut)



0
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 12298065
Okay,
I will look into them.

How to work with Textfield??
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Assisted Solution

by:JK2429
JK2429 earned 75 total points
ID: 12298416
0
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 12298598
Ok I get idea to work with TextField. I need to use TextListener

0
 
LVL 37

Expert Comment

by:zzynx
ID: 12299364
Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question