Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Right Click Option in JtextPane

 
Siddique Ansari
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to get options "Add to Name".. etc.. and am getting that.. but my problem is when I right click first then it show all MenuItems once, When I right click Again it shows all the options twice, when I right click again then it shows thrice. Tell me whats the problem?


 
Piet Souris
Ranch Hand
Posts: 1152
19
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siddique,

well, have a look at line 17. You add an item to a menu. But suppose that item was already present in that menu (say, from a former right mouse click)?

Greetings,
Piet
 
Campbell Ritchie
Sheriff
Posts: 48386
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Siddique Ansari
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THANKS....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic