Author: Real Gagnon
Author's WebSite: http://tactika.com/realhome/realhome.html
The JTextPane can display simple HTML page.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
public class TestShowPage {
public static void main(String args[]) {
JTextPane tp = new JTextPane();
JScrollPane js = new JScrollPane();
js.getViewport().add(tp);
JFrame jf = new JFrame();
jf.getContentPane().add(js);
jf.pack();
jf.setSize(400,500);
jf.setVisible(true);
try {
URL url = new URL("http://www.tactika.com/realhome/contents.html" );
tp.setPage(url);
}
catch (Exception e) {
e.printStackTrace();
}
}
}
Posted On: 5-Jul-1999