This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
Disable DoubleClick in JTextField
Capture paste event and pasted text as well.
Remove Keystroke event for enter key
How to make text field to accept only alphabets.