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.
相关问题
- Click only through holes in svg mask
- Capture (trap) the mouse cursor in a window in Jav
- jquery fancybox triggered click only working once
- Windows IME: custom Korean virtual keyboard
- How to use iDangerous Swiper and jquery .click();
相关文章
- Button onclick doesn't fire after onchange inp
- Android Button needs two click for action
- How to add onClick event on card view [closed]
- Windows: send Mouse/Keyboard event to background w
- BHO for capturing user clicks works fine in Window
- execute sql query on button click
- Moving mouse to stop monitor from sleeping [duplic
- click() with links
thats the one from your 1st code
this is the 2nd part
This isn't particularly a JUNG question--the canvas is just a standard-issue Swing canvas with some additional capability grafted on, and you're not clicking on a graph element--but GraphEditorDemo and PluggableRendererDemo demonstrate something similar.
Following code will create a popup menu when right-clicking either on the vertex or on the canvas...
Add the class into an
AbstractModalGraphMouse
class 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.