On JButton, I want to list information on several lines. I tried \n as a newline character, but that didn't work. The following code:
\n
JButton.setText("fnord\nfoo") ;
will display as:
fnordfoo
How to force a line break?
JButton accepts HTML, so to break the line use:
JButton.setText("<html>fnord<br />foo</html>");