Simple.java
// package nov25.browser;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;

public class Simple {
    
    public Simple() {
        JFrame main = new JFrame("A Simple Browser");
        main.setSize(600, 400);
        main.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = main.getContentPane();
        Box addr = Box.createHorizontalBox();
        addr.add(new JLabel("Address:"));
        final JTextField addrfield = new JTextField("http://gradcenter.marlboro.edu/~msie/2001/ipl/home.html");
        addr.add(addrfield);
        content.add(BorderLayout.NORTH, addr);
        final JEditorPane browser = new JEditorPane();
        browser.setEditable(true);
        try {
            URL src = new URL(addrfield.getText());
            browser.setPage(src);
        } catch (java.net.MalformedURLException mf) {
            browser.setText("Bad url!");
        } catch (java.io.IOException io) {
            browser.setText("IO error!");
        }
        JScrollPane scroller = new JScrollPane();
        scroller.getViewport().add(browser);
        content.add(BorderLayout.CENTER, scroller);
        addrfield.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                try {
                    URL src = new URL(addrfield.getText());
                    browser.setPage(src);
                } catch (java.net.MalformedURLException mf) {
                    browser.setText("Bad url!");
                } catch (java.io.IOException io) {
                    browser.setText("IO error!");
                }
            }
        });
        main.show();
    }

    public static void main (String args[]) {
        new Simple();
    }

}

syntax highlighted by Code2HTML, v. 0.9-jb1