Creating a JButton with multiple lines of text

In the Swing 1.1.1 Beta 1 release of JFC 1.1, the Swing team added the ability to use HTML to specify a button’s text.
Here’s an example:

import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
public class Main extends JFrame {
   public Main() {
      getContentPane().setLayout(new FlowLayout());
      JButton button = new JButton("<html><font size=-1><b><u>Click-Me!</u></b>" 
                                 + "<p>Do so!</html>");
      addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent event) {
      setSize(400, 400);
   public static void main(String[] args) {
      (new Main()).show();