I want to add a right click popupmenu to a JTable in NetBeans IDE (seems like a simple task... lol)
I got it to partly work by
- adding a popupmenu to the form
- adding menuitems to the popupmenu
- go to properites of JTable
- click binding tab
- set ComponentPopupMenu value to my popupmenu
But this only partly works. Now I when I right click on the Table the menu pops up, but the selected row in the JTable does not change. So in when the menuitem's actionPerformed is called I have no idea what row in the JTable was clicked on.
How can I get this? or is there an easier way to do this in netbeans?
I know there are others ways of doing this (in code), but I would prefer to use netbeans GUI builder.
Has anyone ever done this before?
Thanks for your help!