3

I want to apply my popup menu for multiple rows that I select with the mouse.

When I drag the mouse it selects the rows, but when I right click for popup menu it selects only 1 row. As it shows on the picture: from 1 to 2.

I want the popup menu to be able to remove mutiple rows at once.

enter image description here

If it helps, I am implementing: MouseAdapter - the method mousePressed. FocusListener - the method focusGained. ActionListener - the method actionPerformed . ListSelectionModel - that implements the valueChanged method.

Also using a JMenuItem , and DefaultTableModel.

Please help.

Davis8988
  • 298
  • 4
  • 16
  • 1
    “I am implementing: MouseAdapter - the method mousePressed. FocusListener - the method focusGained. ActionListener - the method actionPerformed . ListSelectionModel - that implements the valueChanged method.” To do what? Edit your question and include the code for each of those listeners. My guess is that you are using a MouseListener to display the JPopupMenu; I recommend avoiding MouseListener and using [setComponentPopupMenu](http://docs.oracle.com/javase/8/docs/api/javax/swing/JComponent.html#setComponentPopupMenu-javax.swing.JPopupMenu-) instead. – VGR Aug 23 '16 at 13:24

0 Answers0