HTML file in Swing

I need to call an HTML file in the Swing application. I am not able to so that. Can some one help with that. My basic idea is to open an application on the system start up. The application should contain the HTML file. Any help would be appreicaited.

try this link n go thru the file:
http://examples.oreilly.com/jswing2/code/ch23/MiniBrowser.java

Similar Messages

  • Help to show a HTML file in Swing

    Hiiiiiiiiiii,
    During my development Me in a problem . Please help me out.
    As per my current context of the project I have to develop a HTML page with Help of CSS and all other things. After that I have to Show the HTML file through Swing. I know how to attach a file with help of URL but need some help to show a HTML file in Swing.
    *help to show a HTML file in Swing*

    As camickr said Javascript support is not available. If you want to support you have to write code for that. Up to an extent CSS support is provided.
    Sample code to display HTML pages in JTexPane (you can use JEditorPane as well):
    Construct the URL:
    URL url = YourClass.class.getResource("resources/Hello.html");
    // If YourClass is in package test.html, then your html page must be available in .....test/html/resources directory.
    // And your CSS files must be accessible from your HTML page. This you can test by simply opening the html
    // page in your favorite browser.And then call setPage() method of HelpDataPane. Note that, HelpDataPane supports hyperlink activation.
    import java.io.IOException;
    import java.net.URL;
    import javax.swing.JTextPane;
    import javax.swing.event.HyperlinkEvent;
    import javax.swing.event.HyperlinkListener;
    * A pane to display help pages. Help pages are accessed as URL and displayed
    * in this pane.
    * @author Mrityunjoy Saha
    * @version 1.0
    public class HelpDataPane extends JTextPane {
         * Creates a new instance of {@code HelpDataPane}.
        public HelpDataPane() {
            super();
            this.addHyperlinkListener(new HyperlinkListener() {
                public void hyperlinkUpdate(HyperlinkEvent e) {
                    if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
                        setPage(e.getURL());
         * Sets the current URL being displayed.  The content type of the
         * pane is set, and if the editor kit for the pane is
         * non-{@code null}, then
         * a new default document is created and the URL is read into it.
         * @param page The URL to be displayed.
        @Override
        public void setPage(URL page) {
            try {
                super.setPage(page);
            } catch (IOException ex) {
                try {
                    URL blankURL = YourClass.class.getResource("resources/Blank.html");
                    super.setPage(blankURL);
                } catch (IOException ioe) {
                    ioe.printStackTrace();
    }Thanks,
    Mrityunjoy

  • Help Needed in opening a HTML File from swing application

    Hi,
    I am opening a HTML file in Internet Explorer from my swing application.
    I am using the code given below
    private final static String WIN_FLAG = "url.dll,FileProtocolHandler";
    private final static String WIN_PATH = "rundll32";
    String cmd = WIN_PATH + " " + WIN_FLAG + " " + url;
    // url is HTML file Path
    Process p = Runtime.getRuntime().exec( cmd );
    The HTML file is opening up,but it always opens behind the swing application,that makes me every time to maximize the HTML file after it being opened up.
    I want to open it in front of the Swing Application.
    Any Help Please ?
    - Manikandan

    Check your Application's JFrame properties (may be ur Frame is set to be in top position ,always),and also check running your application in some other OS.

  • Kindly help me how to view html file in swing using jbutton

    hello..im a begginer at j2se language and im working on my school project..kindly help me how to view html files by clicking button at javax.swing..thanks

    Here you go:public class HTMLViewer implements Runnable, ActionListener
         public void run() {
              JFrame frame = new JFrame("View HTML");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JButton button = new JButton("Click me!");
              button.addActionListener(this);
              Container cp = frame.getContentPane();
              cp.add(button, BorderLayout.CENTER);
              frame.pack();
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e) {
              if (Desktop.isDesktopSupported()) {
                   Desktop d = Desktop.getDesktop();
                   try {
                        d.browse(new URI("www.google.com"));
                   } catch (IOException ex) {
                        ex.printStackTrace();
                   } catch (URISyntaxException ex) {
                        ex.printStackTrace();
         public static void main(String[] args) {
              EventQueue.invokeLater(new HTMLViewer());
    }If that's not what you're looking for you need to ask more specific questions.

  • How to create html files using Swing

    I am developing a billing system in java. I want to generate cash memo and other related documents in HTML format. I have explored html package in swing but without result. Please help me.
    Arshad

    Hi,
    I agree with the previous poster. An additional way of generating HTML would be to directly write it. Class SHTMLWriter in package com.lightdev.app.shtm of application SimplyHTML at http://www.lightdev.com/template.php4?id=3 gives this opportunity.
    With this, you can do something such as   /**
       * example of synthesizing HTML code to a Writer using
       * class SHTMLWriter
       * @param fileName the name of the file to write HTML to
      public void writeHTML(String fileName) {
        try {
          FileWriter fw = new FileWriter(fileName);
          SHTMLWriter w = new SHTMLWriter(fw);
          w.startTag(HTML.Tag.HTML.toString(), null);
          w.startTag(HTML.Tag.BODY.toString(), null);
          SimpleAttributeSet set = new SimpleAttributeSet();
          set.addAttribute(CSS.Attribute.FONT_FAMILY, "SansSerif");
          set.addAttribute(CSS.Attribute.FONT_SIZE, "12");
          w.startTag(HTML.Tag.P.toString(), set);
          fw.write("some text");
          w.endTag(HTML.Tag.P.toString());
          w.endTag(HTML.Tag.BODY.toString());
          w.endTag(HTML.Tag.HTML.toString());
        catch(Exception e) {
          e.printStackTrace();
      }The HTML output is hard coded in this example. Certainly any HTML code can be created dynamically/programmatically instead. Class SHTMLWriter is partly meant as a convenience class for writing HTML. One can just through start and end tags as in above example. In the start tag any valid AttributeSet can be given.
    HTH
    Ulrich

  • How to embed html-file into swing

    hello,
    can anybody help me how to embed a html-file into a swing application??
    I try to write a swing-application, that connects to a Internetpage via Sockets.
    The problem is, that I can only see the sourcecode of the InternetPage in my JTextArea, but I want to see the whole Page just like in a browser.
    I hope anybody can help me to solve this problem, thanx mina

    u will need to use the JEditorPane component instead of Jtextarea.here is a url to help u get started
    http://java.sun.com/docs/books/tutorial/uiswing/components/simpletext.html#editorpane

  • How to add xyz.html page to swing container?

    Hi,
    can any one help me to embed a html file in swing container. i am new to swings.
    Thanks,
    Sai.

    It's called "Swing", we have a forum dedicated to that, and try JEditorPane.

  • How to use Swing html to parse a html file..

    I am currently working on a project in java.i need to read a Html file, extract the table tag along with its contents if it has a button embedded in it and replace it with another code..
    i tried it with Reg Ex in java but in vain.. Any help is great... I need an idea of how to use Html parser for this prob.. any examples will be fine..

    Run the program from command line, this way you will see the errors, if any.
    example.: java -jar theJarfile.jar
    I was successful in creating a comm application. I placed the win32com.dll in the same directory of my application jar file and all worked.
    I also extracted the comm.jar , and jar'd my app with the extracted comm files to make one jar.
    I also had a fileWriter() to get the clients jre path and my app would write the javax.properties file to the correct place.
    It took me severel weeks and late nights to accomplish this, but it was all necessary to be able to install only my app, and not a bunch of api's that were needed.

  • Getting links and its names from a html file

    Hi everyone
    My problem about the a getting links with name from a html file. For example
    İn a web page in this site ?SUN? when use click SUN the browser open http://java.sun.com
    İ want both of them, so the links and name. I can succeeded the get link but i don t know how to get the link name.
    For example :
    <B>setRightComponent(Component)</B>
    &#304;n this code segment i want to get B tag. But how i don t know. To get A tag i used this code
    List result = new ArrayList();
    try {
    // Create a reader on the HTML content
    URL url = new URI(uriStr).toURL();
    URLConnection conn = url.openConnection();
    Reader rd = new InputStreamReader(conn.getInputStream());
    // Parse the HTML
    EditorKit kit = new HTMLEditorKit();
    HTMLDocument doc = (HTMLDocument)kit.createDefaultDocument();
    kit.read(rd, doc, 0);
    // Find all the A elements in the HTML document
    HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A);
    while (it.isValid()) {
    SimpleAttributeSet s = (SimpleAttributeSet)it.getAttributes();
    String link = (String)s.getAttribute(HTML.Attribute.HREF);
    if (link != null) {
    result.add(link);
    it.next();
    &#304; can use B tag but i don t know hot to get its value because it has no prefix such as HREF....
    i am sorry if i use a bad explanation style or incorrect word.

    import java.io.*;
    import java.net.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    class GetLinks
        public static void main(String[] args)
            throws Exception
            // Create a reader on the HTML content
            Reader reader = getReader( args[0] );
            // Parse the HTML
            EditorKit kit = new HTMLEditorKit();
            HTMLDocument doc = (HTMLDocument)kit.createDefaultDocument();
            doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
            kit.read(reader, doc, 0);
            // Find all the A elements in the HTML document
            HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A);
            while (it.isValid())
                SimpleAttributeSet s = (SimpleAttributeSet)it.getAttributes();
                String href = (String)s.getAttribute(HTML.Attribute.HREF);
                int start = it.getStartOffset();
                int end = it.getEndOffset();
                String text = doc.getText(start, end - start);
                System.out.println( href + " : " + text );
                it.next();
        // If 'uri' begins with "http:" treat as a URL,
        // otherwise, treat as a local file.
        static Reader getReader(String uri)
            throws IOException
            // Retrieve from Internet.
            if (uri.startsWith("http:"))
                URLConnection conn = new URL(uri).openConnection();
                return new InputStreamReader(conn.getInputStream());
            // Retrieve from file.
            else
                return new FileReader(uri);
    }

  • How to show applets in a html file ?

    Hi all
    I have created an applet with jdev ,and I also generated the corresponding html file and a main method. So the java file runs standalone when I click on the run button , but when I copied the class file and the html file in a web server, then there is nothing in the applet region ! Can anyone help me ?
    Here are the code :
    Code of the java file :
    // Copyright (c) 2001
    package pack_applet;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    * Applet
    * <P>
    * @author xxxx
    public class Capplet extends JApplet {
    boolean isStandalone = false;
    String x;
    String y;
    JLabel label = new JLabel();
    * Constructs a new instance.
    * getParameter
    * @param key
    * @param def
    * @return java.lang.String
    public String getParameter(String key, String def) {
    if (isStandalone) {
    return System.getProperty(key, def);
    if (getParameter(key) != null) {
    return getParameter(key);
    return def;
    public Capplet() {
    * Initializes the state of this instance.
    * init
    public void init() {
    x = this.getParameter("x", "0");
    y = this.getParameter("y", "1");
    try {
    jbInit();
    catch (Exception e) {
    e.printStackTrace();
    private void jbInit() throws Exception {
    this.setSize(new Dimension(400, 400));
    this.getContentPane().add(label, BorderLayout.CENTER);
    label.setText("x = "+x+" y = "+y);
    * start
    public void start() {
    * stop
    public void stop() {
    * destroy
    public void destroy() {
    * getAppletInfo
    * @return java.lang.String
    public String getAppletInfo() {
    return "Applet Information";
    * getParameterInfo
    * @return java.lang.String[][]
    public String[][] getParameterInfo() {
    String[][] pinfo =
    {"x", "String", ""},
    {"y", "String", ""},
    return pinfo;
    * main
    * @param args
    public static void main(String[] args) {
    Capplet applet = new Capplet();
    applet.isStandalone = true;
    JFrame frame = new JFrame();
    frame.setTitle("Applet Frame");
    frame.getContentPane().add(applet, BorderLayout.CENTER);
    applet.init();
    applet.start();
    frame.setSize(400, 420);
    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
    frame.setVisible(true);
    frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } });
    static {
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    catch(Exception e) {
    e.printStackTrace();
    And code of the html file :
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <HTML>
    <TITLE>
    HTML Applet Test Page
    </TITLE>
    </HEAD>
    <BODY>
    <SCRIPT LANGUAGE="JavaScript"><!--
    var info = navigator.userAgent; var ns = false;
    var ie = (info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0
    && _info.indexOf("Windows 3.1") < 0)
    //--></SCRIPT>
    <COMMENT><SCRIPT LANGUAGE="JavaScript1.1"><!--
    var _ns = (navigator.appName.indexOf("Netscape") >=0
    && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0
    && java.lang.System.getProperty("os.version").indexOf("3.5") < 0)
    || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0)));
    //--></SCRIPT></COMMENT>
    pack_applet.Capplet will appear below in a Java enabled browser.<BR>
    <SCRIPT LANGUAGE="JavaScript"><!--
    if (_ie == true) document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = 400 HEIGHT = 400 ALIGN = middle NAME = "TestApplet" codebase="HTTP://java.sun.com/products/plugin/1.2/jinstall-12-win32.cab#Version=1,2,0,0"> <NOEMBED><XMP>');
    else if(_ns == true) document.writeln('<EMBED type="application/x-java-applet;version=1.2" WIDTH = 400 HEIGHT = 400 ALIGN = middle NAME = "TestApplet" java_CODE = "pack_applet.Capplet" java_CODEBASE = "Capplet.class" "x" = "0" "y" = "1" pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"> <NOEMBED><XMP>');
    //--></SCRIPT>
    <APPLET CODE = "pack_applet.Capplet" CODEBASE = "Capplet.class" WIDTH = 400 HEIGHT = 400 ALIGN = middle NAME = "TestApplet" >
    </XMP>
    <PARAM NAME = CODE VALUE = "pack_applet.Capplet" >
    <PARAM NAME = CODEBASE VALUE = "Capplet.class" >
    <PARAM NAME = NAME VALUE = "TestApplet" >
    <PARAM NAME = "type" VALUE = "application/x-java-applet;version=1.2">
    <PARAM NAME = "x" VALUE = "0">
    <PARAM NAME = "y" VALUE = "1">
    </APPLET>
    </NOEMBED></EMBED></OBJECT>
    </BODY>
    </HTML>
    Thank you very much.

    you can load your pdf into your browser using
    navigateToURL(new URLRequest("yourpdf.pdf"));

  • Xml to JTree, and JTree node to html file.

    I have been trying to figure out a way to do this and I think I have a solution, but I am not sure how to structure the application and methods.
    working with BorderLayout Panel p, JSplitPane split, JTree tree, and JEditorPane rpane
    1st. My JSplitpane is divided with the tree, and rpane. The tree is on the left, and the rpane is on the right. both of these are then added to the Panel p
    2. I will create a method that will read through a modules.xml file, and create a JTree - tree. When you click on the node element it's information is displayed in the right pane - rpane.
    The Problem. I think it would take to long to create the html file on the fly each when I click on each individual node.
    So my idea is to create the html files from many xml files when I run the program. I can then just load the html file when I click on each individual node.
    This means alot of heavy processing in the front end, and everything will be static, but it will be faster when the user is in the program.
    Problem. How do I associate each node element with the correct html file?
    The Tree elements are always the same, but I can have 1 or many modules.
    Here is an example:
    <device>  // - root
       <module1>
          <Status>
             <Network></Network>
             <Device></Device>
             <Chassis></Chassis>
             <Resources></Resources>
          </Status>
          <ProjMngt></ProjMngt>
          <ProjEdit></ProjEdit>
          <Admin>
             <admNetwork></admNetwork>
             <admUsers></admUsers>
          </Admin>
          <Logging></Logging>
       </Module1>
       ...  Now I can have 1 or many Modules depending on what the xml file  has in it.
       <Module*n>
    </device>Other problems. Some of the information I want to store as a sortable Table, but I cannot seem to get any of the sort methods to work. They work if I just open a browser, and run the html file, but if I stick the html file into the JEditorPane it does not work? - any suggestions?
    Also, can I pass a JTabbebPane to the JEditorPane, or can I create a tabbed pane in html that will do the same thing.
    I am working with a very small device. It does not have a web application container like Tomcat on it. Just Apache, and Java. That is why I am using Swing.

    Using 'productAttribute/text()' gets you all three productAttribute nodes and then grabs all the text under that node. It simply concatenates together all the text under the desired node, hence the results you are seeing. If you want to get the text for each child node separately, then you need to do something like (assumes 10.2.x.x or greater)
    WITH your_table AS (SELECT
    '<root><productAttribute>
    <name>Baiying_attr_03</name>
    <required>false</required>
    </productAttribute>
    <productAttribute>
    <name>Baiying_attr_04</name>
    <required>false</required>
    </productAttribute>
    <productAttribute>
    <name>Baiying_attr_05</name>
    <required>false</required>
    </productAttribute></root>' xmldata
    FROM DUAL)
    -- Above simulates your DB table as I don't have it
    -- You only care about the following
    SELECT xt.*
      FROM your_table yt,
           XMLTable('/root/productAttribute'
                    PASSING XMLTYPE(yt.xmldata)
                    COLUMNS
                    prd_nm   VARCHAR2(30)  PATH 'name',
                    prod_rqd VARCHAR2(5)   PATH 'required') xt;Note: I added a <root> node as you had just provided a XML fragment. You will need to adjust accordingly.
    The above produces
    PRD_NM                         PROD_RQD
    Baiying_attr_03                false
    Baiying_attr_04                false
    Baiying_attr_05                false

  • Writing html file in a jeditorpane

    I have read one of your threads titled as "How to insert a string in a JEditorPane (Urgent)". according to this thread I am using insertString() method to write in an jeditorpane. what I am writing is an html file. when I used insertString() method it doesn't show the html content in my jeditotpane. it displays the source code of my html file. I have setContentType("text/html"); moreover I used setText() and it shows the html file correctly but it over writes the previous content of jeditorpane. please help me to be able to
    write to a jeditorpane without overwriting and displaying html file properly not its source code.
    following is my code:
             fr = new FileReader("myfile.html");
         BufferedReader br = new BufferedReader(fr);
         while ((lineread = br.readLine()) != null)
              find.append(lineread);
                       do{
                             last = find.lastIndexOf("str");
                          Integer index = myJEditorPane.getSelectionEnd();
                   String temp = index.toString();     
                   start=find.indexOf(temp, end);
                   end=find.indexOf("str", start);
                            Document doc = mynewContentPane.getDocument();
                   try{
                        doc.insertString(doc.getLength(),find.substring(start, end),null);
                   catch(BadLocationException exc){
                        exc.printStackTrace();
                   }Edited by: nasi on May 7, 2010 8:59 PM
    Edited by: nasi on May 8, 2010 12:09 AM
    Edited by: nasi on May 8, 2010 1:37 AM

    Welcome to the Sun forums.
    Subject: writing html file in a jeditorpane
    If you mean a JEditorPane then please use the correct case, so we can be confident you refer to the J2SE class, as opposed to a 3rd party jeditorpane that we neither know, nor support.
    nasi wrote:
    I have read one of your threads titled as "How to insert a string in a JEditorPane (Urgent)". ..I guess you mean [How to insert a string in a JEditorPane (Urgent)|http://forums.sun.com/thread.jspa?threadID=282569] from 2002. A lot has changed since 2002, but I suspect the basic way of appending text to a Document has not.
    BTW - Good to see you arrive with some Google-foo. ;-)
    ..according to this thread I am using insertString() method to write in an jeditorpane. what I am writing is an html file. when I used insertString() method it doesn't show the html content in my jeditotpane. it displays the source code of my html file. I have setContentType("text/html"); moreover I used setText() and it shows the html file correctly but it over writes the previous content of jeditorpane. I've not played much with changing existing documents, but try this source (adapted from code nabbed from the thread you mentioned).
    import javax.swing.text.*;
    import javax.swing.*;
    public class InsertStringTest {
        public static void main(String[] args){
            Runnable r = new Runnable() {
                public void run() {
                    //set GUI
                    JFrame f = new JFrame();
                    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    JEditorPane editorPane = new JEditorPane();
                    editorPane.setContentType("text/html");
                    editorPane.setText("<html><body><h1>Test!</h1><p>");
                    f.getContentPane().add(new JScrollPane(editorPane));
                    String testStr = "This is a test string. " +
                        "This is a test string. This is a test string. \n";
                    f.pack();
                    f.setSize(400,300);
                    f.setVisible(true);
                    //test with insertString()
                    long diff;
                    long startTime = System.currentTimeMillis();
                    Document doc = editorPane.getDocument();
                    for(int i=0; i < 500; i++){
                        try{
                            doc.insertString(doc.getLength(),testStr,null);
                        catch(BadLocationException exc){
                            exc.printStackTrace();
                    diff = System.currentTimeMillis() - startTime;
                    System.out.println("Time spent with doc.insertString() : " + diff);
                    editorPane.setCaretPosition(0);
            SwingUtilities.invokeLater(r);
    }

  • A helloworld java applet that will work on an html file

    I have spent a lot of time trying to get a java applet to work on a web page. Of course, I can download zip packages and they will work. But I can?t seem to find a formula for creating something simple that will work.
    All the examples that I have found will either work on Windows when running it on the command line, or work in Netbeans, but none of them will work when I put time into an html file on a linux web server.
    Can someone post, maybe the simplest code that will output ?Hello world? on a Linux Apache Web server.
    I have the gist for creating and programming java? as least a basic start. But I?m anxious to see an example that I can compile that will actually display on an html file and not just my Windows programming environment.
    Thanks in advance for any feedback on this.
    -- L. James
    L. D. James
    [email protected]
    www.apollo3.com/~ljames

    AndrewThompson64 wrote:
    apollothethird wrote:
    I have spent a lot of time trying to get a java applet to work on a web page. Of course, I can download zip packages and they will work.Does that somehow relate to this problem? What exactly does a Zip 'package' do when it 'works'?It displays the text on the web page.
    >
    .. But I can&#146;t seem to find a formula for creating something simple that will work.
    All the examples that I have found will either work on Windows when running it on the command line, or work in Netbeans, but none of them will work when I put time into an html file on a linux web server.
    Can someone post, maybe the simplest code that will output &#147;Hello world&#148; on a Linux Apache Web server.
    Is that a question? Please make sure to add a question mark.
    // <applet code='HelloWorldApplet' width='400' height='300'></applet>
    import javax.swing.*;
    public class HelloWorldApplet extends JApplet {
    public void init() {
    add(new JLabel("Hello World!"));
    validate();
    I have the gist for creating and programming java&#133; as least a basic start. ... Applets are not for newbies. Leave them alone for at least another 6 months.Thanks, Andrew. The lines of text you provided were very enlightening. I was able to do a lot of dissecting and experimenting and have the full gist of my question answered. I don?t have any problems outputting either text on the console or text on browsers.
    -- L. James
    L. D. James

  • How to put an HTML file into JEditorPane

    Hi
    I am doing an aplication on swing.But I don't know how to add a html file to the JeditorPane keeping the html file on the source code. i.e my html file is in my source code.Then how to add this source code to Jeditor pane.
    Thanks
    Srikant

    hi srikkant,
    ur html code is inside the source code..? are you working on applets..? if ur html file can be read as a file and the file stream can converted to a string and put into a Jeditor pane using the setText() method. for editing HTML text a editor called javax.swing.text.html.HTMLEditorKit can be used.
    Refer to JAVA API for further clarifiactions and examples.

  • How to show an HTML file (more then 1MB size) in JEditorPane

    I an trying to show an HTML file (more then 1 MB size ) in JEditorPane
    but getiing OutOfMemory error.
    if i try the same for size less then 1 MB(i tried till 850KB) then it will work fine.
    I am using setPage() method of JEditorPane.
    please provide solution .

    I meet the same question, and even worse.
    I created a html file with frameset, when i point to the link which is an html file larger than 500kb . it fails. and some error "infinite loop in formatting" is thrown
    in javax. swing.text.FlowView. I read the code of this class, and can't tell what's the error of my application.
    Can someone help and give some answer?

Maybe you are looking for