Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
JLabel - How to get text on two lines?
James Hodgkiss
Ranch Hand
Posts: 401
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Does anyone know how I can get a JLabel to use two lines of text? I have tried using /n but it doesn't treat it as a line-break...
If it can't be done with JLabel, does anyone know which component I should be using?
Thanks,
James
Mateus Hooker
Greenhorn
Posts: 4
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
String
s = "<html>If you're feeling lazy<br>use html markup<br>then play golf...</html>";
JLabel label = new JLabel(s);
James Hodgkiss
Ranch Hand
Posts: 401
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Mateus,
Haven't got time for the golf bit, but the html tip is great - cheers!
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
wordwrap_JTable
Line brake in JLabel?
BorderLayout
JTable cells and html
Multiline JLabel
More...