Results 1 to 5 of 5
  1. #1
    asifsolkar is offline Member
    Join Date
    Dec 2007
    Location
    India
    Posts
    14
    Rep Power
    0

    Unhappy jeditorpane help parsing html

    I am developing an application which needs a web browser functionality like Mozilla or internet explorer.

    I have tried several examples of displaying web pages in jEditorPane but it doesnt seem to work well for me

    I am doing my development in netbeans 6.0 here is the code

    Java Code:
    private void jEdpaneBrowserHyperlinkUpdate(javax.swing.event.HyperlinkEvent evt) {                                               
            
            HyperlinkEvent.EventType type= evt.getEventType();
             final URL url = evt.getURL();
             if (type == HyperlinkEvent.EventType.ENTERED) {
                  System.out.println("URL: " + url);
             }else if (type == HyperlinkEvent.EventType.ACTIVATED) {        
                 System.out.println("Activated");
                 EditorKit htmlKit = jEdpaneBrowser.getEditorKitForContentType("text/html");
           HTMLDocument doc = (HTMLDocument) htmlKit.createDefaultDocument();
           jEdpaneBrowser.setEditorKit(htmlKit);
    
          try {
           InputStream in = url.openStream();
           //jEdpaneBrowser.setPage(url);
            jEdpaneBrowser.read(in, doc);
            in.close();
            // set the combo 
          } catch (IOException ioException) {
            System.out.println("Error following link" + ioException);
            jEdpaneBrowser.setDocument(doc);        
            
          }
        }
    but this code doesnt load pages properly like internet explorer or Mozilla
    the pages that dont load are Google , Yahoo! etc

    Flash pages are set blank nothing loads..

    yahoo recomends me to upgrade the browser i feel jeditorpane cannot render html like InternetExplorer or Mozilla

    Please help how can render this html , is there any html renderer which can help me do this .

  2. #2
    staykovmarin is offline Senior Member
    Join Date
    Nov 2007
    Location
    Newport, WA
    Posts
    141
    Rep Power
    0

    Default

    Java CANT render flash, thats why you dont see anything. The only way i have read is about using a quicktime wrapper, since quicktime can use flash.

    yahoo recomends me to upgrade the browser
    Of course it will, since you are NOT using Internet Explorer, or Mozilla. Nor are you sending a message to the website, to trick it to think that you are a different browser. Unfortunately i dont remember how i did that (it was about 2 years ago) but i am sure you can find it trough a little bit of googling

  3. #3
    asifsolkar is offline Member
    Join Date
    Dec 2007
    Location
    India
    Posts
    14
    Rep Power
    0

    Default

    thanks staykovmarin for your reply i have tried Lobo browser which is an open source . they have used cobra 0.97.4 to parse the html so its able to load google.com properly , but not flash site Flash Template # 17616 by Hugo . even lobo browser built on the similar framework does not load flash site . is there any html render which can do this

  4. #4
    staykovmarin is offline Senior Member
    Join Date
    Nov 2007
    Location
    Newport, WA
    Posts
    141
    Rep Power
    0

    Default

    Its not the HTML renderer that's the problem. Flash uses its own language/interpreter. They used to make it for java, but that stopped back in flash2. Like i said, there might be some solution using Quicktime, since Quicktime can interpret flash.

  5. #5
    asifsolkar is offline Member
    Join Date
    Dec 2007
    Location
    India
    Posts
    14
    Rep Power
    0

    Default

    I just did some study on the reference browser software which is made in java and loads the pages well just like Internet Explorer does

    to check some info on the browsers ,I did the following test
    Browser Security Test

    and found that Internet Explorer and this Java Software browser are identical

    the Result of Internet Explorer 7

    Your browser reports to be: "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; .NET CLR 1.1.4322; FDM; .NET CLR 3.5.21022)"

    Browser name: MSIE
    Version: 7.0
    Platform: Windows Vista

    Result of the Java Browser is

    Your browser reports to be: "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; .NET CLR 1.1.4322; FDM; .NET CLR 3.5.21022)"

    Browser name: MSIE
    Version: 7.0
    Platform: Windows Vista


    Result on Mozilla Firefox

    Your browser reports to be: "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"
    Browser name: Firefox
    Version: 2.0.0.11
    Platform: Windows Vista


    What does this mean can i use IE dll to make my browser in java , how can this be done please help i feel i am closer to my target

    Thanks

Similar Threads

  1. html web page parsing/scraping
    By orchid in forum Advanced Java
    Replies: 3
    Last Post: 10-21-2010, 02:34 PM
  2. [SOLVED] Hide the titlebar of a JEditorPane
    By Eranga in forum AWT / Swing
    Replies: 1
    Last Post: 03-28-2008, 11:28 AM
  3. Replies: 0
    Last Post: 02-06-2008, 04:55 PM
  4. JEditorPane
    By drmmr11 in forum Java Applets
    Replies: 0
    Last Post: 08-02-2007, 07:08 PM
  5. Adding custom highlight to JEditorPane
    By andrewb in forum AWT / Swing
    Replies: 0
    Last Post: 06-22-2007, 07:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •