Mega Code Archive

 
Categories / Java Tutorial / Swing
 

Displaying Simple HTML Files

import java.awt.BorderLayout; import javax.swing.JEditorPane; import javax.swing.JFrame; public class Main {   public static void main(String[] argv) throws Exception{     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(300, 300);     frame.setVisible(true);   } }