简体   繁体   中英

How to make JButton text appear?

汇总结果

In the above image the left shows code for the set of 4 seats in yellow on the left. I tried to change the font size to try to make it fit in the box but I can't get them to show up. For now the text on the JButtons are all "..." but I want them to display their labels, which are only 3 characters. What can I do to the JButtons to get them to display the labels? Perhaps removing the JButton border space?

Would it be possible to eliminate the thick border around the text (left and right)?

The margin controls the space between the text and the Border:

seats[I].setMargin( new Insets(5, 5, 5, 5) );

Also, in the future post actual code, not a picture of the code. And the code should be in the form of a SSCCE so we know exactly what your are doing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM