Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Newline char in JLabel  RSS feed

 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Is it possible to view set of lines with the "New line char" in a JLabel ?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. JLabels can display HTML, and to do this, you have to use HTML. Something like

JLabel myLabel = new JLabel("<html>Hello,<br>World</html>");

will show up on two lines.
 
Srinivasa Raghavan
Ranch Hand
Posts: 1228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the info Ernest.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!