What is JEditorPane - Java Swing

Java examples for Swing:JEditorPane

Introduction

JEditorPane can handle plain text, HTML, and Rich Text Format (RTF).

JEditorPane is primarily used to display a very basic HTML document.

The support for RTF content is very basic.

To use a JEditorPane to display a HTML page.

import java.io.IOException;

import javax.swing.JEditorPane;

public class Main {

  public static void main(String[] args) {
    try {
      JEditorPane htmlPane = new JEditorPane("https://www.java2s.com");
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
}

Related Tutorials