How to add text area on JOptionPane
official tutorial contains example for that, another examples here
Put a JTextArea
into JOptionPane.showConfirmDialog()
(of type QUESTION_MESSAGE
) then query the content of the text area once the dialog is disposed (and checking the return result to ensure the dialog was not cancelled by the user).