Rotation Components: Vertical Text Question

If I have a button similar to the one shown in this image:

http://www.freeimagehosting.net/image.php?4cd775814c.png

How can I make the text display vertically? As in

j
B
u
t
t
o
n
1

I would like to know how to do the same for JLabel. I'm sure there should be a better way than creating as many shortcuts as there are characters in a line. Correctly?

EDIT: how can I insert an image in my post? The button for the image shows the image in the preview section, but when I actually send the data, I only get the text back, for example, the tags become damaged.

+3
source share
2 answers

HTML JButton JLabel. ,

button = new JButton("<html>J<br>b<br>u<br>t<br>t<br>o<br>n<br>1</html>");

.

+5

, , , . , (/ ) . , , , .

, ; HTML label.setUI(new VerticalLabelUI(true)); ( < > ).

+7

Source: https://habr.com/ru/post/1699079/


All Articles