This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Right Click Option in JtextPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Right Click Option in JtextPane" Watch "Right Click Option in JtextPane" New topic
Author

Right Click Option in JtextPane

Siddique Ansari
Greenhorn

Joined: May 11, 2013
Posts: 21
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

Joined: Mar 08, 2009
Posts: 728
    
  11
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

Joined: Oct 13, 2005
Posts: 41098
    
  29
And welcome to the Ranch
Siddique Ansari
Greenhorn

Joined: May 11, 2013
Posts: 21
THANKS....
 
rocket mass heater kickstarter
 
subject: Right Click Option in JtextPane