Sunday, 15 July 2012

java - JLabel remove space between text and border -



java - JLabel remove space between text and border -

i creating jlabel text (customized part of program). cannot post images here, label comes padding (meaning there gap between text , border.)

i don't want padding thick. there way compress padding won't thick? these things have tried (one one, not altogether)

setpreferredsize(width, height); setborder(new emptyborder(new insets(0,0,0,0))); setborder(new emptyborder(new insets(-5,-5,-5,-5)));

but none of them works. @ shrink jlabel padding stays same. padding ends covering text instead. understand setmargin may work jlabel doesn't seem have setmargin i'm lost. help appreciated, give thanks you!

i figured out. 'border' saw panel instead of label. label's background transparent (i did not setopaque(true) label). turns out label has no padding @ all, wanted. understand why there padding on panel (done flowlayout) well. give thanks mkorbel speedy response! i'll close question.

java swing border jlabel

No comments:

Post a Comment