Loading Web Page To JEditorPane : JEditorPane « Swing « Java Tutorial






Loading Web Page To JEditorPane
import java.net.URL;

import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JScrollPane;

public class LoadingWebPageToJEditorPane {

  public static void main(String[] a)throws Exception {
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    JEditorPane editorPane = new JEditorPane();

    editorPane.setPage(new URL("http://www.java2s.com"));

    frame.add(new JScrollPane(editorPane));

    frame.setSize(300, 200);
    frame.setVisible(true);
  }

}








14.35.JEditorPane
14.35.1.Loading HTML Documents as a StyledDocument into a JEditorPane
14.35.2.Loading Web Page To JEditorPaneLoading Web Page To JEditorPane
14.35.3.Using Actions with Text Components: JEditorPane
14.35.4.Show html
14.35.5.Change mouse cursor during mouse-over action on hyperlinks
14.35.6.JEditorPane Look and Feel
14.35.7.How to change mouse cursor during mouse-over action on hyperlinks