Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.awt.BorderLayout;

import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JScrollPane;

public class Main {

    public static void main(String[] args) {
        JEditorPane htmlPane = new JEditorPane();
        String description = "<html><body>Hello<table border=1>"
                + "<tr><td><img alt='Bad' src='http://www.java2s.com/style/download.png'/></tr></td></table></body></html>";
        htmlPane.setContentType("text/html");
        htmlPane.setText(description);

        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLayout(new BorderLayout());
        frame.add(new JScrollPane(htmlPane));
        frame.pack();
        frame.setVisible(true);
    }

}