Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JLabel/Font specification/Urgent

 
Sonara Rahul
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
I have a problem in specifying font for all my labels.
For eg:
I have a label "qwert yuio pasdfgf hjkkl zxcvcxbx" .
I need font arial 12pts.
I specify it in html tag as follows:
JLabel jLab=new JLabel("<html>

qwert yuio pasdfgf hjkkl zxcvcxbx</html>");
All the attributes described is reflected in my label,but the line-height:18px is not reflected.
The label is placed in TextPane or just in panel.
--------------
qwert yuio |
|
pasdfgf hjkkl|
|
zxcvcxbx |
--------------
My need is to reduce the spacing b/w the lines,so i have mentioned it as "line-height:18px ".
But this is not reflected in any way in java. So pl.. help me in reducing the space b/w the lines that could be specified only within html tag.
Excepting u'r replies.
with regards,
Sonara.

 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
try to specify an instance of Font and set this Font for your label. (I dont know, if you can specify the line height, though).
are you coding under Linux? html in java is not rendered nicely under linux.
chantal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic