Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Truncated text in Label

 
iyappan sankaran
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i have a probelm :
In windows the text in Jlabel is displayed correctely like

HI Iyappan

while in solaris the text get truncated and displayed like this

HI Iyp. . .

i attach source
. . .
getContentPane().setLayout(null);
l1=new JLabel("HI Iyappan");
getContentPane().add(l1);
getContentPane().add(l2);
l1.setBounds(100,10,40,15);
. . .


urgent pls give solution .
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A width of 40 pixels is probably not sufficient, because the default font may be different on Solaris than the one on Windows. That's one of the resons why it's better not to use absolute positioning, but to let a layout manager do the work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic