Source Code : HTML label

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

HTML label

HTML label
 
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;
import javax.swing.JLabel;

public class HtmlLabel extends JFrame {
  public HtmlLabel() {
    super("HTML Buttons");
    setSize(400, 300);

    getContentPane().setLayout(new FlowLayout());

    String htmlText = "<html><p><font color="#800080" "
        + "size="4" face="Verdana">JButton</font> </p>"
        + "<font size="2"><em>" + "with HTML text</em></font></html>";
    JLabel btn = new JLabel(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 HtmlLabel();
  }
}
           
         
  

Thank with us