> Is there a possibility to place the JButton text _on top_ of a JButton
> icon instead of next to it (which is the default if the constructor
> new JButton(String text, ImageIcon icon) is used)?
> I would like to be able to place the text above the image.
Extend JButton and overide paintComponent()
(and probably getMinimumSize()/getPreferredSize()).
Andrew T.
Parachute - 27 Feb 2007 07:23 GMT
Hi,
> Extend JButton and overide paintComponent()
> (and probably getMinimumSize()/getPreferredSize()).
I finally found an easier solution:
start_button = new JButton("Start", new GradientIcon(Color.blue,
Color.gray));
start_button.setHorizontalTextPosition(0);
Setting the horizontal text position to 0 places the text above the
image.
Thanks anyway!