Sep 23

Use the JButton classes setVerticalTextPosition() and setHorizontalTextPosition() methods to control the text positioning.

JButton button = new JButton("Press Me", icon);

// Text below image


// And centred


written by objects \\ tags: ,

Array ( ) One Response to “How do I display an image in a JButton with the text centered below the image?”

  1. Faruq Says:

    It is more simple and useful.

Leave a Reply

You must be logged in to post a comment.