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