How can I shift html-text in the JButton to the left?
- by Roman
I use HTML to put text into a JButton. In this way I can play with colors and text size. What I do not like is the distance from the left border of the button and the text (this separation is too large). Is there a way to decrease this distance? I think it should be some parameter in the style of the HTML code.
Sample of the code:
JButton btn = new JButton("<html><span style='color:#000000; font-size: 11pt;'>" + label + "</span></html>");