title: Proper way to implement mouse events
body: <p>I have code, it's below, that displays a photograph in the JPanel.  Actually, the JPanel is walking through a photo album and I have it so that when the JPanel is clicked on, the panel advances to the next frame.  I also have it configured so that if the JPanel is right-clicked on, a popup menu is displayed.</p>
  
  <p>I read that, when implementing a popup menu, one needs to override both mousePressed() and mouseReleased() in order to catch the trigger for all platforms.  However, since I have a listener associated with the JPanel, when the user clicks the window the JPanel advances two photos.  This is understandable, but how should I code this so that I ensure I display the popup on all platforms (my professor may check my program on Linux and I have to code it on Windows at home).</p>