The second constructor

public JEditorPane(URL u)


     JFrame f = new JFrame("O'Reilly & Associates");
     f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    
     try {
       URL u = new URL("http://www.oreilly.com");
       JEditorPane jep = new JEditorPane(u);
       jep.setEditable(false);   
       JScrollPane scrollPane = new JScrollPane(jep);     
       f.getContentPane().add(scrollPane);
     }
     catch (IOException e) {
       f.getContentPane().add(
        new Label("Could not load http://www.oreilly.com"));
     } 
      
     f.setSize(512, 342);
     f.show();

Previous | Next | Top | Cafe con Leche

Copyright 1999, 2000 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified January 23, 2000