private void profileListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_profileListMouseClicked
        // Handles right clicks and double clicks on the Profile List
        if(evt.getClickCount() == 2){
            try {
                if(evt.getX() <= 16){
                    // Clicked on the icon
                    if(dbIconActivates)
                        activateProfile();
                    else
                        launchGame();

                } else {
                    // Clicked on the text

                    if(dbTextAction == 2){
                        launchGame();
                    } else if(dbTextAction == 1){
                        activateProfile();
                    } else {
                        // Rename the profile
                        showRenamePopup();
                    }
                }
            } catch(Exception ex){
                // Log the error and inform the user
                Main.handleException(null, ex, Main.LOG_LEVEL);
                infoTxt.setText("An error has occured.");
            }
        } else if(javax.swing.SwingUtilities.isRightMouseButton(evt)){
            // Set the selected index to the item being righ clicked on
            profileList.setSelectedIndex(
                    profileList.locationToIndex(evt.getPoint()));
            
            // Show the right click menu (Only when something is selected).
            if( !profileList.isSelectionEmpty() )
                profilePopupMenu.show(evt.getComponent(), evt.getX(), evt.getY());
        }
    }//GEN-LAST:event_profileListMouseClicked