Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Right click popup menu in a JTable

843806Sep 29 2008 — edited Sep 29 2008
I have an extended JTable that I want to add a popup menu to that would appear when the user right clicks on a table row.

It is currently implemented and working except there appears to be a problem when the table is in a scroll pane and is scrolled.

The code I use to show the populate is as follows:
menu.show( MyTable.this, e.getX(),e.getY() ) ;
And the symptons are that if the table has a scroll bar ( i.e. there are more rows then can be displayed ) and I scroll down to some lower rows and right click the mouse, the popup menu appears just fine but the table is automatically scrolled back to the top row and the selected row isn't visible.

Any ideas here?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2008
Added on Sep 29 2008
2 comments
381 views