0

I have a JLabel of 20x10 it has IconImage of 20, what i want is that the image set on bottom,

JLabel FONDO=new JLabel(Imagen("cas.png"));
       FONDO.setBounds(10, 30, 20, 10);

after i do mouseEvent the code change:

FONDO.setBounds(10, 30, 20, 20);

image of my problem

enter image description here

the IconImagen is set on center... I needs it be on bottom

thanks for your advices!

mKorbel
  • 109,525
  • 20
  • 134
  • 319
WearFox
  • 293
  • 2
  • 19
  • search for vertical and horizontal Alignment in JLabel API, if without any success, then to try to set [proper LayoutManager to JLabel, see answer by @Andrew Thompson](http://stackoverflow.com/a/18434145/714968) – mKorbel Aug 27 '13 at 18:37
  • Alignment don't have vertical alignment, and the LayoutManager use another JLabel, it doesn't work for me, thanks – WearFox Aug 27 '13 at 18:42
  • I think you can to align both direction, search for setHorizontal/VerticalTextPosition or something similair or the same methods SwingConstant.Xxx – mKorbel Aug 27 '13 at 18:54
  • oooooh thanks yes you have the reason i add this code: fondo.setVerticalAlignment(JLabel.BOTTOM); it works perfectly!! – WearFox Aug 27 '13 at 19:03
  • :-) ............................. – mKorbel Aug 27 '13 at 19:58

0 Answers0