HTML Page with Applet in JEditorPane

Hi,
I have a JEditorPane in which i want to show a HTML page which has an Applet embedded in it. Is there anyway that I can do this as if I just give the URL of the HTML file it gives me a text field with applet tag written in it.
Or is there any other way that I can embed an Applet in my application in one of Swing components.
Thanks in advance,

Update:
You may want to extend HTMLEditorKit:
public class MyHTMLEditorKit extends HTMLEditorKit() {
    static ViewFactory viewFac = new HTMLFactory(){
       public View create(Element el) {
          if(el.getName().equalsIgnoreCase("APPLET")) {
              Applet app = ...; // create applet from other attributes
          else return super.create(el);
}Check this out. I don't know whether applet elements are included in the parsed document; nevertheless, check it out.
Fritz

Similar Messages

  • Displaying html page with in the applet

    I want to open an html page in the applet. If i use showDocument() of applet, it opens the html page in the browser, but i want to open the html page with in the applet(i.e., applet should display the html page). Is there any way which i can do the above thing.
    Thanks in advance

    Look at this sample:
    import java.awt.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.text.*;
    public class BrwsA extends JApplet
         JPanel      jpa = new JPanel();
         JEditorPane jed = new JEditorPane();
         JScrollPane jsp = new JScrollPane(jpa);
    public BrwsA()
         jpa.setLayout(new BorderLayout());
         jpa.add(jed);
         jpa.setPreferredSize(new Dimension(800,1000));
         jed.setEditable(false);
         jed.setContentType("text/html");
         jed.getEditorKit().createDefaultDocument();
         setContentPane(jsp);
    public void init()
         try
              URL url = new URL(getCodeBase(),"test.html");
              jed.setPage(url);
         catch(MalformedURLException e)
         catch(IOException e)
    }Noah

  • Opening html page with in the applet

    I want to open an html page in the applet. If i use showDocument() of applet, it opens the html page in the browser, but i want to open the html page with in the applet(i.e., applet should display the html page). Is there any way which i can do the above thing.
    Thanks in advance

    Use a JEditorPane to display HTML (supports version 3.2 though)
    check API (that's for JDK 1.4.1 so check for version you use)
    http://java.sun.com/j2se/1.4.1/docs/api/javax/swing/JEditorPane.html
    Sky

  • Replace HTML page with an applet

    Hello to everybody!
    I created a servlet who can manage file upload from an HTML page.
    Now I want to replace that HTML page with an applet.
    I know that I need to use multipart/form-data , but I have no experience with applet.
    HTML page code is:
    <html>
    <head><title>Upload</title></head>
    <body>
    <FORM ACTION="http://localhost:8080/examples/servlets/servlet/UploadTest" ENCTYPE="multipart/form-data" METHOD=POST>
    What is your name? <INPUT TYPE=TEXT NAME=submitter> <BR>
    Which file do you want to upload? <INPUT TYPE=FILE NAME=file> <BR>
    <INPUT TYPE=SUBMIT>
    </FORM>
    </body>
    </html>
    Any help for "translating" this html page into an applet?
    Applet will send, like html page, a string and a file.
    Thanks in advance, Liuk

    If you use something like Apache Http Client you dont have to do any low level implementations.
    Also if you are the one who is writing both servlet and applet you dot have to stick to standerd formats. you can develop your own format and write both servlet and applet to handle it. that kind of thing can be done easily even with URLConnection. But if you plan to send large files then URLConnection may not be the right option becouse I have seen many complaining that URLConnection gives OutOfMemoryErrors when uploading large amounts of data.

  • A tree-view in HTML page with nodes generated with java script in run time is not visible in the UI Automation Tree. Need Help

    I have a HTML page with an IFrame. Inside the Iframe there is a table with a tree view
    <iframe>
    <table>
    <tr>
    <td>
    <treeview id="tv1"></treeview>
    </td>
    </tr>
    </table>
    </iframe>
    In UIA, i am able to traverse till the tree view but not able to see it.
    I have used the TreeWalker.RawViewWalker Field to traverse the node from the desktop Automation.RootElement. 
    I tried to use AutomationElement.FromPoint method to check whether i am able to get that element. Fortunately i was able to get the automation element. 
    i tried to get the path to root element from the node element using the TreeWalker.RawViewWalker. I was able to get the parent path to the root element.
    But trying the reverse way like navigating from root element to tree node, was not getting the element for me. 
    Please help me with suggestions or inputs to resolve this issue. 

    Thanks Bernard,
    It works fine with JInitiator but not working with
    the JPI. For JPI what settings I need to do ??hi TKARIM and Bernard, i am having similar problem even with the Bernard's recommended setup. could you post the webutiljini.htm (i presume you are using config=test) ?
    i am actually using jinitiator 1.3.1.28 with Oracle HTTP Server of OAS 10gR2) calling Forms Server 6i (f60cgi). After setting up according to Bernard's recommended setup steps, the java console showed that it loaded the icon jar file when it could not read the form, but it skipped the loading of the icon jar file once it read and started the form. How do we specify in the form to pick up the icon from the jar file instead from a directory ? Or do we need to specify ? Any ideas ?
    Thx and Regards
    dkklau

  • How to call html page with in the flash

    I am new to action script, can some one guide me how to call html page with in the flash. lets say i have movie clip having instance name as "news_feed", I need to disply the html page in this news_feed. kindly help me, thanks alot

    some one tell me, weather it is possible or not ??

  • Designing Embedded HTML Page with iWeb

    I designed a html page with with an embedded html page within it. It all looks fine in iWeb, but when I upload the page to the intenet and I try to view this page it does not come up properly. Although I initially see the page come up as I designed it (for a fraction of a second) it then disapears and I only see the page I embedded on my page.
    I added the following codes in HTML Snippet:
    <object data=http://www.mls.ca/PropertyResults.aspx?&vs=Residential&ret=300&curPage=PropertySearch.a spx&sts=0-0&beds=0-0&baths=0-0&bt=1%2c16%2c17&atsg=%2c&ci=cartierville&pro=4&mp= 500000-0-0&mrt=0-0-4&trt=2&of=1&ps=10&o=D width="600" height="400"> <embed src=http://www.mls.ca/PropertyResults.aspx?&vs=Residential&ret=300&curPage=PropertySearch.a spx&sts=0-0&beds=0-0&baths=0-0&bt=1%2c16%2c17&atsg=%2c&ci=cartierville&pro=4&mp= 500000-0-0&mrt=0-0-4&trt=2&of=1&ps=10&o=D width="600" height="400"> </embed> Embedd a web page within another web page. </object>
    <object data=http://www.mls.ca width="600" height="400"> <embed src=http://www.mls.ca width="600" height="400"> </embed> Embedd a web page within another web page. </object>
    As I said, the above pages come up fine in iWeb but not when I search them with Sagari.
    Can someone please help with this. Thanks, Padano

    This is the proper code :
    <iframe src="http://url.to.file.html" frameborder="0" width="500" height="500" scrolling="no" allowTransparency="true"></iframe>
    You can also use this :
    <div style="width: 650px; height: 650px">
      <script language="JavaScript">
        location.replace('../../../your files.html');
      </script>
    </div>
    Source : iframe alternative in the HTML Snippet
    And on this page you can see how to use <object> for html, png and jpg files :
    Embed content with the <object> HTML element

  • Building HTML page with JSP from different applications

              Hi,
              we need to build a HTML page with 2 JSPs. If both JSP were in the same Application
              (Weblogic 8,1) there is no problem. But I have to use JSPs from differents web
              applications, each JSP is in different war files.
              How can I compose this page? How can I management the request object?
              thanks
              

    Your program print the whole jsp source code??
    This is your web server configuration problem.
    Your web server handle your jsp page like text file only.

  • Rewrite a complete HTML page with all result inside with JSP

    i have generate a HTML page with JSP. Then by an action on a menu on the left frame,i have to rewrite this page with the data already seized, and more code inside(i.e complete the page).
    How can i do ?

    Use JavaScript to tell the other frame to reload or to go to another location. Generate the JavaScript if you're processing a request of the menu...

  • How to upload a HTML page with Flash image viewer?

    I´ve got a html page with a flash image viewer file inn it. Preview in a browser is ok, but I don´t get it right on the server. Is it something spesial with the swf file?
    This is what i have done: I just upload html -page, viewer swf file and the pictures to the same folder. Is this wrong?
    Sorry, I really don´t have a clue... Thanks!

    Sorry to say, but that is not a webpage -
    There is no doctype, no head section, no body section .
    etc. etc.
    Nothing would work in that document.
    Please generate a properly formed HTML page, and place the scripts and script calls in the proper section and the rest in the body, and let's see what you get

  • To add meta tags, you open your published .html pages with TextEdit or any other text editor and modify as required. You have to do redo it each time you republish. Ihow do I do this? I need step by step instructions

    To add meta tags, you open your published .html pages with TextEdit or any other text editor and modify as required. You have to do redo it each time you republish. I need step by step instructions on how to accomplish this  please .

    Rage Sitemap Automator and iWeb SEO Tool are two different applications.
    Use SEO Tool to add the title tag and meta description. These need to be added to the html file for every page of your website. SEO Tool stores all these so that when you republish you only need to add tags to any new pages and click the re-apply button to refresh the existing ones.
    Once you have added. refreshe the tags with iWeb SEO Tool and uploaded the files with your FTP application, then open the site in Sitemap Automator and create and upload a new sitemap.
    Once you have set up accounts with Google, Yahoo and Bing, verified your site with each and submitted a sitemap, on subsequent publishing Sitemap Automator will resubmit the sitemap with one button click. It will also notify Ask.com whch doesn't require an account since you can add your domain name to this URL to ping them...
    http://submissions.ask.com/ping?sitemap=http%3A//www.domain.com/sitemap.xml

  • Problem Printing html page with JEditorPane...

    Hello All,
    I Have a problem in printin html file with JEditorPane...
    My Html file contains a Table on it..
    Problem is that JEditorPane displays the html file correctly but
    it prints the file without print that Table..
    So pls help me...
    Thanx in advance,..
    Amit
    [email protected]

    I think you would know how to retrieve content of an HTML page using the URL object. Just in case.
    My apology if this short note doesn't help you at all.

  • Applet blinks  when  launched  in a html page with black background

    Dear sirs:
    I 'm testing a game applet and preparing for deployment. However, whenever i reload the html page containg the applet, the applet will first appear as a white block and then switch to black-background( i set black as bg in first sentence at applet's init() ) .
    It's really annoying as the bgcolor of html is black. I try to set the applet and div's visibility be hidden, but the problems remains. And i try to add a black div covering on the applet( with z-index = 200) , it still blinks.
    Does anyone know how to startup the applet with background other than white?
    I use windows, and jre1.6.0.1 plugin.
    i Searched in google with no result.
    Thanks a lot.

    an initial fade in/out is added after init() function to reduce the flicking.
    some javascript tricks are used to reduce the white flashing after reloading. now it's much better and acceptable.
    However, i still want to know does anyone have some better tricks?
    There's a bug report in 2002 which is shown as "fixed", "closed". i think it's the same problem( in fact not fixed).
    The applet does not start up with the background color set in init() function. It first appears as a white block for 0.2-0.3 second, then switches to the user defined bgcolor . really annoying.

  • Any Way to display HTML pages on Applet

    Hi All,
    Is there any way to show web pages on Applet?
    Is it possible ?

    I am not aware of a simple way to display HTML in an applet. However, I have used the JEditorPane to display HTML documents. Handling links, etc. with this component requires some effort. Also requires Swing.
    Have you considered using the applet to display a page on the browser. (i.e. getAppletContext().showDocument(URL, [frame name]))? Just an idea.
    Good luck.

  • Plugin problem in JSP page with applet

    i am using applets in my jsp page. the applet works properly if the java plugin is installed. it is not working with the default jvm.
    my question is
    if any client who does not have java plug in, views the page the plugin should be downlaoded automaticllly.
    how do i get this happen.
    Need support from Applet Gurus
    Cheers!!!!!!!!!!!!!!

    If you are using the <applet> tag, then it will not try to download the plugin. You should use the <object> and <embed> tags, which will only use the plugin, not the default JVM.
    See the bottom of this page...
    http://java.sun.com/products/plugin/1.3/docs/intranet.html
    Only IE has a JVM built-in (and Netscape 4.x, if anyone still uses it). And in either case, that JVM is version Java 1.1.4, so it's very old.

Maybe you are looking for

  • I cannot send Yahoo eMail from iPad or iPhone, but I can receive

    I cannot send Yahoo eMail from iPad or iPhone, but I can receive.

  • OIM 11g R1 - Add user to group after AD Reconciliation

    Hi, i want to add all reconcilated users from AD to OIM to a special role in oim, after a AD reconciliation. By default, all users get the role ALL_USERS. I want to add a futher role, for example ALL_AD_USERS. How to do this? Edited by: 960944 on Jan

  • Display problem in Nokia XL

    I purchased a Nokia XL last month (Purchased online). After a normal usage of almost 15 days, during office hours, the Display got white vertical lines. If you lock the screen and unlock after some time , the display looks clear, after some time the

  • Error ORA-20001 when Creating an Application Express Workspcce

    I have a 11.1.0.6.0 Enterprise Edition database running on a Fedora 10 box that was created using dbca. At the time, I did not select Oracle Application Express for installation. However, I can configure APEX and start it with URL http://<host>:8080/

  • Solution Manager interface

    Hi, Can anyone give me assistance in the following requirement: When a call is created in solution manager (v4), I need to transfer the data through XI to an external help desk and visa versa. Where do I start? Thanks, Leanne