// A program that is a very simple WWW browser. // Barry Cornelius, 31st January 2000 import java.awt. BorderLayout; import java.awt. Container; import java.io. IOException; import javax.swing. JEditorPane; import javax.swing. JFrame; import java.util. Properties; public class Browser { public static void main(final String[] pArgs) throws IOException { // you will need to uncomment the following three statements // if your access to the WWW is through a proxy machine // you will have to replace proxymachine.sitename.com // and 8080 with appropriate values for your site // final Properties tProperties = System.getProperties(); // tProperties.put("http.proxyHost", "proxymachine.sitename.com"); // tProperties.put("http.proxyPort", "8080"); final JEditorPane tJEditorPane = new JEditorPane(); tJEditorPane.setPage("http://www.dur.ac.uk/understanding.java/"); final JFrame tJFrame = new JFrame("Browser"); final Container tContentPane = tJFrame.getContentPane(); tContentPane.add(tJEditorPane, BorderLayout.CENTER); tJFrame.setLocation(100, 100); tJFrame.setSize(500, 300); tJFrame.setVisible(true); } }