I need a text pop up like the one you get with JOptionPane.showInputDialog(null, "Text");
Just with multiple lines, like...
I'm new to java.
I have no background in programming.
I could use some help
How would I do this?
Common Methods of JOptionPane class It is used to create a dialog with the options Yes, No and Cancel; with the title, Select an Option. static String showInputDialog(Component parentComponent, Object message) It is used to show a question-message dialog requesting input from the user parented to parentComponent.
Passing null to it just indicates that there's not an associated "parent" dialog - ie, the dialog being displayed does not belong to another dialog.
You have to use \n to break the string in different lines.
You could use '\n' like so:
JOptionPane.showMessageDialog(null, "Hello\nworld");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With