Right Click Menu

55 views
Skip to first unread message

Karen Potts

unread,
Apr 10, 2013, 1:39:16 AM4/10/13
to piccolo...@googlegroups.com
In Piccolo2D, is it possible to have a right click menu that pops up when you right click? For example, when you right click on a desktop or in a web browser you are given some options that highlight as you mouse over them and then you can click on one? If so, what is the best way to do this?

Michael Heuer

unread,
Apr 10, 2013, 11:14:57 AM4/10/13
to piccolo...@googlegroups.com
Hello Karen,

If you are using Piccolo2D.Java, the canvas (PCanvas) is a JComponent
so you may add a right click menu using the usual pattern

http://docs.oracle.com/javase/tutorial/uiswing/components/menu.html#popup


For example, I use this

http://dishevelled.svn.sourceforge.net/viewvc/dishevelled/tags/dsh-identify-1.0/src/main/java/org/dishevelled/identify/ContextMenuListener.java?revision=1240&view=markup

to build a context menu around line 305 here

http://dishevelled.svn.sourceforge.net/viewvc/dishevelled/trunk/venn-cytoscape3-app/src/main/java/org/dishevelled/venn/cytoscape3/internal/DiagramView.java?revision=1373&view=markup

michael
> --
> You received this message because you are subscribed to the Google Groups
> "Piccolo2D Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to piccolo2d-use...@googlegroups.com.
> To post to this group, send email to piccolo...@googlegroups.com.
> Visit this group at http://groups.google.com/group/piccolo2d-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages