How can I set multiple lines of text in a Button?


There is no way to set Multiple Lines of Text in an AWT button. If you try to attach a label whose length is more than the width of button it is trimmed on both sides.

You can have multi-line Buttons in Swing, however. The latest version of Swing allows you to specify the button text using HTML, and you can add <br> tags inside the HTML (as well as tags such as <b> and <i>)

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact