EarthWeb
Developer.com
Site
windows 2000
visual c++
java
visual basic
javascripts
recommend it
 
Book
thinking in java
 
Interact
forum
guest book
jobs
jokes
what's new

share code
 
Resource
add resource
modify resource
new resource
 

[Internet Jobs]
-----
Java by E-mail:

Get the weekly e-mail highlights on Java!
-----

-

Display HTML in a JScrollPane


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

internet.commerce



Acceptable Use Policy

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers