import java.awt.FlowLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JButton;
import javax.swing.JFrame;
public class HtmlButtons extends JFrame {
public HtmlButtons() {
super("HTML Buttons");
setSize(400, 300);
getContentPane().setLayout(new FlowLayout());
String htmlText = " + "size=\"4\" face=\"Verdana\">JButton
"
+ "" + "with HTML text";
JButton btn = new JButton(htmlText);
getContentPane().add(btn);
WindowListener wndCloser = new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
};
addWindowListener(wndCloser);
setVisible(true);
}
public static void main(String args[]) {
new HtmlButtons();
}
}