SyntaxFix
Write A Post
Hire A Developer
Questions
You can do it by putting HTML in the code, so:
JFrame frame = new JFrame(); frame.setLayout(new GridLayout()); JLabel label = new JLabel("<html>First line<br>Second line</html>"); frame.add(label); frame.pack(); frame.setVisible(true);