This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android 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: 459
    
    6
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: 38045
    
  22
And welcome to the Ranch
Siddique Ansari
Greenhorn

Joined: May 11, 2013
Posts: 21
THANKS....
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Right Click Option in JtextPane
 
Similar Threads
JPopupMenu on a JTable Header Selection Problem
Jtree and Popup Menu
Addind a word in the String
smtp server name while using jmail
Addind with javascript