Solved

How to handle cut/copy/paste events on TextField

Posted on 2004-10-13
6
470 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 100 total points
ID: 12297294
add a DocumentListener to the document of the JTextField.
0
 
LVL 37

Accepted Solution

by:
zzynx earned 100 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

 
LVL 4

Assisted Solution

by:JK2429
JK2429 earned 25 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 106
servlet filter example 37 72
arguments to jar 5 35
hibernate example issues from command prompt 10 50
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.

821 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