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.

Similar Messages

  • How to add a 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 html file to Jeditor pane.
    Thanks
    Srikant

    QuickTime requires player and plugins that most people don't have.  You'll reach a much wider audience if you use HTML5 <video> with mp4, webm and ogg files.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 with Video</title>
    <!--help for older IE browsers-->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    </head>
    <style>
    video {
        max-width:100%;
        display:block;
        margin:0 auto;
    </style>
    <body>
    <h2>Use 3 File Types to support all browsers &amp; mobile devices:  MP4, WEBM and OGV.</h2>
    <h3>Online Video Converter
    http://video.online-convert.com/</h3>
    <!--begin video-->
    <video controls poster="Your_poster_image.jpg">
    <!--these are 6 sec sample videos for testing purposes. Replace sample-videos with your own files-->
    <source src="http://techslides.com/demos/sample-videos/small.webm" type="video/webm">
    <source src="http://techslides.com/demos/sample-videos/small.ogv" type="video/ogg">
    <source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4">
    If you're seeing this, you're using an
    outdated browser that doesn't support
    the video tag. </video>
    <!--end video-->
    </body>
    </html>
    Nancy O.

  • How to embed the html file into form 6i?

    How to embed the html file into form. What control activeX should i use? please help!!!!!!

    You can use web.show_document function for this purpose. See
    form builder help topics for more details.
    Hope this helps.

  • How to convert a HTML files into a text file using Java

    Hi guys...!
    I was wondering if there is a way to convert a HTML file into a text file using java programing language. Likewise I would also like to know if there is a way to convert any type of file (excel, power point, and word) into text using java.
    By the way, I really appreciated the help that you guys gave me on my previous topic on how to extract tests from a pdf file.
    Thank you....

    HTML files are already text files. What do you mean you want to convert them?
    I think if you search the web, you can find things for converting those MS Office files to text (or extracting text from them, as I assume you mean).

  • Abstract Portal Component: How to inclue a HTML file into the response?

    Hi experts,
    i am currently working on the problem, that i want to access KM inside my AbstractPortalComponent in order to retrieve a HTML File.Afterwars i want to include this file into my IPortalComponentResponse.
    IPortalComponentResponse offers the method include(IPortalComponentResponse , IResource)
    Is it possible to use this method to achieve my goal?
    I have tried this approach:
    IResourceContext resourceContext = new ResourceContext(requester);
    RID rid = RID.getRID("/documents/test.gif");
    IResource resource = ResourceFactory.getInstance().getResource(rid,resourceContext);
    response.include(request,resource);
    But the problem is that this IResource doesn't match the IResource that is needed for this method.
    My IResource belongs to com.sapportals.wcm.repository.IResource
    But the Methos just works with com.sapportals.portal.prt.resource.IResource
    So can you help me on this one?:)
    With Best Regards
    Marcus

    Hi,
    read the contents of the resource and put them to the output.
    Dumb but working piece of code:
    private String renderResource(IResource resource, boolean html) {
              StringBuffer buf = new StringBuffer("");
              try {
                   IContent content = resource.getUnfilteredContent();
                   if (content != null) {
                        InputStream is = content.getInputStream();
                        byte[] bytes = new byte[(int) content.getContentLength()];
                        int i = is.read();
                        int count = 0;
                        while (i != -1) {
                             char b = (char) i;
                             bytes[count] = (byte) i;
                             count++;
                             i = is.read();
                        buf.append(new String(bytes, "UTF-8"));
                        if (html) {
                             buf.append("</br>");
                        } else {
                             buf.append('\n');
              } catch (Exception e) {
    // do something
              return buf.toString();
    hope this helps,
    Rmano

  • How to load local html-file into webBrowser tool? [SDK 6.5]

    The webbroser tool lets you load an external html by inputting the adress in its "Url"-property.
    But how do you load a local html-file that is added to your project? Lets say the path is: Folder1/Subfolder1/Webpage1.html. What would I put in the Url-property to make this work?
    While on this subject, what is the support for css and javascript when using locally loaded webpages in the webbrowser?

    Thanks for the answer Malleswar, but I have now played around with all variations of that code-line that I can think of, but still I can not locate the html-file that is located within the project. Since Im planning to distribute the html-files with the executable (as one file) it should read it directly from wherever the application is installed.
    The html-file is included within the project. Solution Explorer -> Solution 'myProject' -> myProject -> Webpage1.html
    Which is (as usual) also where the Form1.cs (which contains the webBrowser-component) is located.
    Any ideas of how the Uri should be constructed in this case?
    Thanks,
    Daniel

  • How to combine 3 HTML files into 1 HTML file?

    I'm designing a few layouts for my website recently, and have faced several problem. One of those is regarding "HTML coding", I usually upload files from Photoshop to Dreamweaver and it will automatically help me to generate the HTML code. I wanted to upload my own HTML layout design for my personal blogspot. But I realise that blogspot only allow 1 HTML code for the entire website design and when I did my web design in Dreamweaver (my website consists of HOME, ABOUT, CONTACT pages), it has a total of 3 HTML code for different pages and I couldn't upload it to my blogspot. So I would like to ask how can I actually do to combine all 3 HTML codes into 1 HTML code. Thank you.

    Hi Nancy, I would like to ask you if I'm using Illustrator CS6 instead of Photoshop? After I slice the vector file, I save as web devices > PNG file. But I realise that Ai and Psd do not work as the same, in Ai, it could not save as HTML. So what should I do after slicing images in Ai? :-D
    Another issue I'm facing is that do I have to create <div class> and <div box> to combine all the HTML files together into 1 and upload to blogspot? (1 long HTML that consists of HOME, ABOUT, CONTACT pages). Thank you

  • How to put own mid. file into N5300 Flying Finger ...

    I always get this message: access denied!

    Which camera are the camera raw files from?
    If your able to open the files in the camera raw dialog, then after you done adjusting the image, press the Open button and in the pse 11 editor go to File>Save As>Jpeg

  • 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 put html file into a canevas?

    How to put html file into a canevas?

    Hi,
    would require you to write a JavaBean that interprets the HTML (there are commercial versions of this available)
    Frank

  • I loaded my ipad photos from camera and all the pictures sorted by date.  Next, I did a sync with my computer and the photos were all reorganized into IMPRT folders an out of date sequence.  Any idea how to put the photos back into date files?

    I loaded my ipad photos from camera and all the pictures sorted by date.  I later sync my ipad with my computer and the photos were all reorganized into IMPRT folders an out of date sequence.  Any idea how to put the photos back into date files other than reloading all of them from camera?

    What version of iPhoto?
    Select one and rotate it. Then rotate it back. Does that make it appear? 
    A much better work flow is the keep the photos after importing.  Check the success the import, wait for at least one successful backup cycle then use you camera's format command to reformat the card
    LN

  • Please help -  How to export HTML file into MS word format

    How to export HTML file into MS word file without any change
    in design format?
    As I have been trying to do that but problem is coming in
    formating. Table's witdth and height get disturbed in MS word when
    I import the html file.
    What I do after creating HTML in dreamweaver I save that file
    into .txt format in dreamweaver. and then import it in MS Word. And
    I tried too much for it but invain.
    Please help me in finding the way of solution.
    Please help me as my job is in trouble. It's very urgent
    pleeease help me. I'll be thankful to you.

    Just open the HTML file in Word.
    Walt
    "apollo321" <[email protected]> wrote in
    message
    news:gavbhd$6j4$[email protected]..
    > How to export HTML file into MS word file without any
    change in design
    > format?
    >
    > As I have been trying to do that but problem is coming
    in formating.
    > Table's
    > witdth and height get disturbed in MS word when I import
    the html file.
    >
    > What I do after creating HTML in dreamweaver I save that
    file into .txt
    > format
    > in dreamweaver. and then import it in MS Word. And I
    tried too much for it
    > but
    > invain.
    >
    > Please help me in finding the way of solution.
    >
    > Please help me as my job is in trouble. It's very urgent
    pleeease help me.
    > I'll be thankful to you.
    >

  • How can i stop the Action Wizard from putting the original file into the Source folder with my changed documents?

    How can i stop the Action Wizard from putting the original file into the Source folder with my changed documents?

    [discussion moved to Creating, Editing & Exporting PDFs forum]

  • How can convert HTML file into xml file?

    Hi,
    I am receving one HTML file as an input and i want to convert that receiving(html file) into .xml file.Is there any converter (tools)to do this.Pls if any give me the details with regard.
    Regards,
    mahesh.

    Use the HTMLEditorKit to parse the html file.
    this kit is having the callback methods which
    are called wenever the tag appears in the HTML
    stream.

  • How to import a XML file into the document?

    Hai,
    i had created a table using xml file....
    Now i want to import that xml file tabel into the document...
    Can any one tell me how to import the xml file into the document?
    thanks
    senthil

    Hai...
    this is senthil...
    i'm beginner for creating adobe indesign plugins..
    i want to import a html file in the document...
    i want to create a table by using html tags and
    that table will be imported into the document..
    How shall i do it?
    can any one plzz explain me?

Maybe you are looking for

  • How to convert html to pdf using acrobat sdk 8.0?

    hi I am a beginner of acrobat sdk . I want to know How to use acrobat sdk 8.0 to convert html to pdf? herere some questions : 1:How to support navigation inside PDF file that generated using acrobat sdk 8.0? For example: theres catalog in the top of

  • "The file iTunes Library.itl cannot be read because it was created by a newer version of iTunes"

    I just updated iTunes, and it completed successfully. Then I tried to open it, and it asked for the user agreement like normal. Then it wouldn't open, saying, "The file iTunes Library.itl cannot be read because it was created by a newer version of iT

  • Memory Leak WSEndpointImpl

    Hi all, using R28.1.3-11-141760-1.6.0_24-20110301-1432-linux-x86_64 of jrockit we experience a memory leak in production. So far I only got to obtain an hprof dump, which I analyzed with eclipse MAT. I'm trying to obtain a flight recording as well bu

  • Export size in Apple ProRes

    I'm trying to cut the size of a movie file when I export in FC. I need video to be in 1920X1080 apple prores, but the current size is 3.98GB. Any way to export smaller size video for online upload without loosing too much quality?? Thanks!

  • Internal order error: AuC missing for origin assignment

    Hi, We had this requirement of blocking Internal Orders (their use has been discontinued from the past 2 years). I used KOK4. Many of the orders got blocked except for those of Order Type Capex. The following error appears: AuC missing for origin ass