JOptionPane can be used to create message, input, and confirm dialogs in Java. Message dialogs display a message using showMessageDialog() with options to set the title, icon, and message type. Input dialogs prompt the user for input using showInputDialog() and return the user's response as a string. Confirm dialogs ask the user to confirm or deny using showConfirmDialog() and return an integer value indicating the user's choice.