File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pasting into a JTextArea

 
Joe Lemmer
Ranch Hand
Posts: 171
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I have made a GUI for a v. small application which has some JTextAreas for entering information. Sometimes, I would like to be able to paste the information in from (say) notepad. However, when I right click on the mouse there is no option to do this. Does anybody know how I might set things up so I can paste into the JTextAreas?

Cheers

Joe
 
Paul Clapham
Sheriff
Pie
Posts: 20161
23
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally you would just press Control-V. Does that not work?
 
Clyde DeSouza
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally you would just press Control-V. Does that not work?


That is pasting using keyboard if you want a right click option you have to create Popupmenus no good for Application.



If you are talking about popup menus, then until you add a popup menu or add a mouse listener, a JTextArea by default should not have any options.


You can read this document if you do not know to add popupmenu
http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html
 
Joe Lemmer
Ranch Hand
Posts: 171
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

Thanks guys. Yes ctrl v does work. I'm so used to using the mouse I didn't think of that. Sorry about the silly question!
 
Clyde DeSouza
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that is not good programming practice to use ctrl-V for GUI application mouse is essentially important so while designing must be aware of put both accessibility through keyboard also and through mouse also! in GUI application!
 
James Mathews
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not required Mouse popupmenu!
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic