Don't know what the problem is but it looks like a JLabel renders the HTML correctly:
JLabel label = new JLabel("<html>line 1<br>\nline 2<br>\nline 3");
JOptionPane.showMessageDialog(null, label);
Which doesn't really make sense because I thought a JOptionPane would us a JLabel to render the text?