• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

HELP! URGENT!

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi there
i want to drag and drop with the right mousebutton und the jpopup menu should popup by pressing the left mousebutton.
i have included a mouse listener to my jtable
public class TableMouseListener implements MouseListener {
GenTable ivView;
public TableMouseListener(GenTable view) {
this.ivView = view;
}
public void mouseClicked(MouseEvent e) {
if(e.getClickCount() ==1) {
ivView.ivPopupMenu.show(e.getComponent(), e.getX(), e.getY());
}
}
public void mouseEntered(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e) {
}
}
but now the popup menu pops up by pressing the right and the left mousebutton... how do I force the mouselistener that the popup menu pops up only by pressing the left mouse button.
please can you help me with the drag and drop and the right mouse button... thanx in advance
regards
Steffen
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Steffen,
Try the following lines inside your mouseClicked method

Regards,
Manfred.
 
Steffen Durale
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanx Manfred for your reply,
it works like you posted it... (thanx again!)
but I havent figured out the drag and drop with the right mousebutton...
do anybody have any ideas??
regards Steffen
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic