Rotate a Swing JLabel

后端 未结 4 1480
走了就别回头了
走了就别回头了 2020-12-31 20:42

I am currently trying to implement a Swing component, inheriting from JLabel which should simply represent a label that can be oriented vertically.

Begi

4条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 20:48

    I think it is off because you are translating about the wrong point.

    the size of the object depends on what container you have this in, so while your preferred size might be what you want, your actual size isn't?

    if you have this label in the CENTER of a BorderLayout, the size is always the full size of the container (minus north+south height, minus east+west width)

    so don't you have to translate about the actual size, not preferred size?

提交回复
热议问题