@Override
	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub
		if (arg0.isMetaDown())
		{
			//popup.show(arg0.getComponent(),arg0.getX(),arg0.getY());
			buildPopUp(arg0);
		}
		
		else if(arg0.getSource() == popDelete)
		{
			deleteRows();
		}
		
		else if(arg0.getSource() == popOpen)
		{
			
			JFileChooser chooser = new JFileChooser(); 
			chooser.setLocation(arg0.getX(), arg0.getY());
		    FileNameExtensionFilter filter = new FileNameExtensionFilter("MP3 Audio Files", "mp3");
		    chooser.setFileFilter(filter);
		    chooser.grabFocus();
		    int returnVal = chooser.showOpenDialog(popup);
		    
		    if(returnVal == JFileChooser.APPROVE_OPTION) 
		    {
		    	String chosenFile = chooser.getSelectedFile().getAbsolutePath();
		    	if(addToList(chosenFile))
		    	{
		    		mplayer.stop();
		    		currentIndex = getIndexOf(chosenFile);
		    		if(currentIndex != -1);
		    		JOptionPane.showMessageDialog(null,"CurenntIndex == " + currentIndex);
		    		table.setRowSelectionInterval(currentIndex, currentIndex);
					mplayer.play(chosenFile);
					//currentSong=chosenFile;
		    	}
		    }
		}
		else
		{
			if(arg0.getSource() instanceof JMenuItem)
			{
				JMenuItem selected = (JMenuItem)arg0.getSource();
				System.out.println("You clicked on:" + selected.getText());
				//System.out.println("table.getSelectedRow() == " + table.getSelectedRow());
				if(table.getSelectedRow() != -1)
				{
					String playlistName = selected.getText();
					String fileName = (String) model.getValueAt(table.getSelectedRow(), model.getColumnCount()-1);
					database.insertIntoPlaylist(fileName, playlistName);
				}
			}
		}
		
	}