Simple factorial program using recursion
Recursion

It's good that you are trying to grasp recursion, the more programming patterns you understand, the better. 

But I would disagree that you need to use recursion more often. Generally, it consumes more memory and iterative solutions tend to be faster as well.

As for your solution, I think that if (n == 1) would be clearer than if (n &lt; 2) (also, n &lt; 2 returns 1 for input 0, which is wrong), and I wouldn't save the return value in result, but return it directly.

Exceptions

In recur throwing an IllegalArgumentException makes sense (it is an illegal argument), but showing the dialog here doesn't make that much sense, I would move that to main.

Also, don't throw an exception you just caught without a reason. If you don't want to execute the following function, just put all code in the try and catch the different exceptions.

Other


recur isn't a good name. I would call it factorial or factorialRecursive.
I would wrap the show message code into a function, that way you could also easily exchange it for something else (like a print). If you then further wrap this up in an object, unit testing would also be easier.


Code

If you do all of this, the code would look something like this:

public static void main(String[] args) {
    int factorialNumber = 0;
    try {
        factorialNumber = Integer.parseInt(input("Which number should we compute the factorial of?"));
        print(factorialNumber + " factorial is " + factorialRecursive(factorialNumber) + ".",
                "Result");
    } catch (NumberFormatException nfe) {
        error("Input must be an integer!", "Error");
    } catch (IllegalArgumentException iae) {
        error(iae.getMessage(), "Error");
    }
}

public static int factorialRecursive(int n) {
    if (n &lt; 0) {
        throw new IllegalArgumentException("n must be &gt;= 0 but was " + n);
    }
    if (n &lt; 2) {
        return 1;
    }

    return factorialRecursive(n - 1) * n;
}

public static String input(String message) {
    return JOptionPane.showInputDialog(null, message);
}

public static void print(String message, String title) {
    JOptionPane.showMessageDialog(null,
            message,
            title, JOptionPane.PLAIN_MESSAGE);
}

public static void error(String message, String title) {
    JOptionPane.showMessageDialog(null, message,
            title, JOptionPane.ERROR_MESSAGE);
}