• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help on java code  RSS feed

 
Sammy abbid
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all:

I'm new in java language , I want to verify the bellow code is for copying a text from texarea using menuItem ( copy ) .





Thanks for your suggestion .
 
Carey Brown
Saloon Keeper
Posts: 3329
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it compile? Does it do what you expect? If not, what does it do and what are you expecting?
 
Sammy abbid
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
the compilation work perfeclty
But one I click  on copy menu nothing is copied .
Thanks
 
Carey Brown
Saloon Keeper
Posts: 3329
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have declared two txtrAltGet_1 variables, one local to the listener.
 
Rob Camick
Ranch Hand
Posts: 2828
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The easiest way is to use the default CopyAction provided by the DefaultEditorKit. Then you can copy text from the last text component that had focus:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!