How do I present text vertically in a JLabel ? (Java 1.6)

后端 未结 5 1086
梦谈多话
梦谈多话 2020-12-10 13:09

I\'m looking to have text display vertically, first letter at the bottom, last letter at the top, within a JLabel. Is this possible?

5条回答
  •  爱一瞬间的悲伤
    2020-12-10 13:32

    You can also use the SwingX API

    Bottom to top :

    JXLabel label = new JXLabel("MY TEXT");
    label.setTextRotation(3 * Math.PI / 2);
    

    Top to bottom :

    JXLabel label = new JXLabel("MY TEXT");
    label.setTextRotation(Math.PI / 2);
    

提交回复
热议问题