HTMLButton.java Source code

Java tutorial

Introduction

Here is the source code for HTMLButton.java

Source

import javax.swing.JButton;
import javax.swing.JFrame;

public class HTMLButton {
    public static void main(String args[]) {
        JFrame frame = new JFrame("DefaultButton");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        String htmlButton = "<html><sup>HTML</sup> <sub><em>Button</em></sub><br>"
                + "<font color=\"#FF0080\"><u>Multi-line</u></font>";
        JButton button4 = new JButton(htmlButton);
        frame.add(button4);
        frame.setSize(300, 200);
        frame.setVisible(true);
    }
}