Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Copy,Paste using mouse right click  RSS feed

 
Sam Krishna
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm compiling my code in JDK1.1.8.
I'm getting the following error...Can anyone fix my bug pls...I wanna try these 3 operations cut,copy and paste in my TEXTFIELD of applet...
PopupMenuTest.java:65: Method cut() not found in class java.awt.TextField.
t1.cut();
^
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's because cut() is actually a method of Swing text components... not AWT.

If you're going to be using AWT, you'll have to code all the cut/copy/paste functionality yourself.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!