Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JButton with text below the icon

In Java Swing I would like to create a JButton which contains an image(icon) and some text. In few words a JButton(text,icon). I would like the text to be displayed below the image, and not beside, as in normal JButton layout. Does anyone have an idea on how to achieve this?

like image 391
Anto Avatar asked Jan 23 '23 15:01

Anto


1 Answers

Have a look at the method setVerticalTextPosition in AstractButton using the constant SwingConstants.BOTTOM.

like image 189
Gordon Avatar answered Feb 04 '23 00:02

Gordon