This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes how can consume Paste content in the JTextField Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how can consume Paste content in the JTextField" Watch "how can consume Paste content in the JTextField" New topic
Author

how can consume Paste content in the JTextField

Dingcheng lee
Greenhorn

Joined: Aug 26, 2002
Posts: 18
i do't want user to paste any content in a JTextField.i want to consume the event in the KeyListener.but do that,i am consume the event ,but the content
appear in the JTextField.who can help?
VIJAY Yadlapati
Ranch Hand

Joined: Aug 04, 2003
Posts: 175
Try this code
JTextField textField = new JTextField()
{
public void paste()
{
return;
}
};
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can consume Paste content in the JTextField
 
Similar Threads
Re. validation
Capture paste event and pasted text as well.
Disable DoubleClick in JTextField
How to make text field to accept only alphabets.
Remove Keystroke event for enter key