public void mouseReleased(MouseEvent e)
    {
        if (pressed && method != null && object != null)
        {
            int numArgs = method.getParameterTypes().length;
            Object[] args = new Object[numArgs];
            if (numArgs == 1 && method.getParameterTypes()[0] == ButtonListener.class)
            {
                args[0] = this;
            }
            else
            {
                for (int i = 0; i < numArgs; i++)
                {
                    args[i] = null;
                }
            }
            
            try
            {
                method.invoke(object, args);
            }
            catch (IllegalAccessException ex)
            {
                ex.printStackTrace();
            }
            catch (IllegalArgumentException ex)
            {
                ex.printStackTrace();
            }
            catch (InvocationTargetException ex)
            {
                ex.printStackTrace();
            }
            
            pressed = false;
        }
    }