I would like to have a JButton with both icon (on top) and text (on bottom) aligned to the left. The Button can be resized by the user and both should always remain aligned to the left, like this:
I have tried this
// Text alignment
comp.setHorizontalAlignment(SwingConstants.LEFT);
// text position
comp.setVerticalTextPosition(SwingConstants.BOTTOM);
//set icon alignment?!
comp.setHorizontalTextPosition(SwingConstants.CENTER);
but this is my result (The icon always remains centred in relation to the text!):
Any ideas?


