Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: jTable popup box

  1. #1
    Join Date
    Dec 2010
    My Mood
    Thanked 0 Times in 0 Posts

    Default jTable popup box

    Is there a way to allow the user to right click (I have the code to detect the right click already) but have no idea how to have a mini popupbox (like the one that pops up if you right click on the window in here) inside of a jTable.

    Basically what I want is when a user right-clicks on a row, have a lil box pop up on the side of where the mouse is (like the ones in Internet Explorer if you right click) and they can choose one of the few selections.

  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Thanked 833 Times in 772 Posts
    Blog Entries

    Default Re: jTable popup box

    1) Add a MouseListener to the JTable (you can filter using the MouseEvent.getButton() mask to look for right clicks b) Use a JPopupMenu (Java Platform SE 6) To show the menu

  3. The Following User Says Thank You to copeg For This Useful Post:

    _lithium_ (March 13th, 2011)

Similar Threads

  1. jTable and jdbc
    By _lithium_ in forum JDBC & Databases
    Replies: 6
    Last Post: March 5th, 2011, 01:22 PM
  2. jsp popup
    By hussain4hunt in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: February 1st, 2011, 09:27 AM
  3. Hello everyone! I need help with JTable
    By hektor in forum AWT / Java Swing
    Replies: 6
    Last Post: October 11th, 2010, 10:11 AM
  4. popup menu
    By antonio69 in forum AWT / Java Swing
    Replies: 1
    Last Post: May 20th, 2010, 04:24 AM
  5. Replies: 1
    Last Post: October 23rd, 2009, 03:17 PM