Container content = getContentPane();
content.setLayout(new BorderLayout());
JToolBar urlToolBar = new JToolBar( );
mURLField = new JTextField(urlString, 40);
urlToolBar.add(new JLabel("Location:"));
urlToolBar.add(mURLField);
content.add(urlToolBar, BorderLayout.NORTH);
mEditorPane = new JEditorPane( );
mEditorPane.setEditable(false);
content.add(new JScrollPane(mEditorPane), BorderLayout.CENTER);
openURL(urlString);
mURLField.addActionListener(new ActionListener( ) {
public void actionPerformed(ActionEvent ae) {
openURL(ae.getActionCommand( ));
}
});
mEditorPane.addHyperlinkListener(new LinkActivator( ));
setSize(500, 600);
setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );