Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Pasting into a JTextArea  RSS feed

 
Ranch Hand
Posts: 171
  • 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
 
Sheriff
Posts: 23710
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally you would just press Control-V. Does that not work?
 
Greenhorn
Posts: 26
  • 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
  • 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
  • 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!
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not required Mouse popupmenu!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!