I want to create a pop-up menu, which will appear if i right clicked on the canvas . How can I do this? which function should i modify? Any help would be appreciated.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Following code will create a popup menu when right-clicking either on the vertex or on the canvas…
Add the class into an
AbstractModalGraphMouseclass which handles mouse listeners to make it work:The codes above do work. But, if you use different user data for the generic parts, then you need to modify the codes to suit your design.