• 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

Truncated text in Label

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic