The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > javax.swing.text  [49 examples] > JEditorPane  [1 examples]

e994. Displaying Simple HTML Files

    try {
        String url = "http://java.sun.com";
        JEditorPane editorPane = new JEditorPane(url);
        editorPane.setEditable(false);
    
        JFrame frame = new JFrame();
        frame.getContentPane().add(editorPane, BorderLayout.CENTER);
        frame.setSize(width, height);
        frame.setVisible(true);
    } catch (IOException e) {
    }

 Related Examples

See also: Actions and Key Bindings    Caret and Selection    Events    JFormattedTextField    JTextArea    JTextComponent    JTextField    JTextPane    Styles   


© 2002 Addison-Wesley.