Solved

How to handle cut/copy/paste events on TextField

Posted on 2004-10-13
6
471 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

739 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