FileDocCategorySizeDatePackage
JLabelHTMLDemo.javaAPI DocExample987Sat Mar 20 14:44:08 GMT 2004None

JLabelHTMLDemo

public class JLabelHTMLDemo extends JFrame
Show a JLabel containing HTML.
version
$Id: JLabelHTMLDemo.java,v 1.2 2004/03/20 20:44:07 ian Exp $

Fields Summary
Constructors Summary
public JLabelHTMLDemo()
Construct the object including its GUI

		super("JLabelHTMLDemo");
		Container cp = getContentPane();

		JButton component = new JButton(
			"<html>" +
			"<body bgcolor='white'>" +
			"<h1><font color='red'>Welcome</font></h1>" +
			"<p>This button will be formatted according to the usual " +
			"HTML rules for formatting of paragraphs.</p>" +
			"</body></html>");

		component.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				System.out.println("Thank you!");
			}
		});
		cp.add(BorderLayout.CENTER, component);

		setSize(200, 400);

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	
Methods Summary
public static voidmain(java.lang.String[] args)

		new JLabelHTMLDemo().setVisible(true);