Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
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:
Swing / AWT / SWT
can get label on second line
Raja Mothi
Greenhorn
Posts: 2
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
When I insert a label on frame I can insert on only one line how to get on next line is there any escape sequence like???
Like I want
My name is jay.
I am 21 years old
but I am getting
My name is jay. I am 21 years old
Is there any way by which I can get label on second line
Regards
Michael Dunn
Ranch Hand
Posts: 4632
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If you mean JLabel
import javax.swing.*; import java.awt.*; class Testing extends JFrame { public Testing() { setLocation(400,300); setDefaultCloseOperation(EXIT_ON_CLOSE); JPanel jp = new JPanel(); jp.add(new JLabel("<html>My name is jay.<br>I am 21 years old</html>")); getContentPane().add(jp); pack(); } public static void main(String args[]){new Testing().setVisible(true);} }
Raja Mothi
Greenhorn
Posts: 2
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Michael
You said this is in case of label
So what about othe components?
Can you please put light on this too
Regards
Michael Dunn
Ranch Hand
Posts: 4632
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
>So what about othe components?
Such as?
(the best way to find out is to experiment)
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
s:iterator, can you save values other control tags like s:label? POJO
Why does cons remain equal to null?
MySql array (workarounds?)
String Tokenizer Question
problem in GridBagLayout
More...