How can I shift html-text in the JButton to the left?

Posted by Roman on Stack Overflow See other posts from Stack Overflow or by Roman
Published on 2010-04-29T11:03:52Z Indexed on 2010/04/29 11:07 UTC
Read the original article Hit count: 276

Filed under:
|
|
|

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>");

© Stack Overflow or respective owner

Related posts about java

Related posts about html