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.

Similar Messages

  • 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 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).

  • How to add a video file into an html page

    I would like to add a Quick Time video into a website that i am currently coding for a school project. I have the video file on my hard drive, so I'm not trying to embed it from YouTube. I have tried several ways of placing the video into my webpage, but all I can hear is the sound from it, there is no visual to go with it. Does anyone know how I would go about placing the file into my webpage, or what code I would need to use? I'm using Dreamweaver CS4 and, once again, the video is a Quick Time file.
    Thanks in advance.

    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 add static resource file into the NetBean project

    I have several static data files(such as icons, images and etc.) need to be loaded by the program. How to add them into the NetBean project?
    Thanks

    Try a NetBeans forum. This is the Java Compiler forum.

  • 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

  • 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 add a jar file into resource catalog in webcenter spaces

    Hi All,
    i am new to webcenter spaces. my requirement is like, i have created one adf taskflow and deployed it as a shared library.now i want to register this jar file as a resource catalog into webcenter spaces (i.e. already deployed). How to achieve this task.
    Thanks,
    Monika

    Pls do the foll actions:
    Step 1:
    File -> Import -> Selct radiobutton - "Jar file" -> Next
    -> Select the file name(ur jar file) - > click on the java button and ensure that u have selected all the file or what evre files u want " -> Finish
    If at all u r not getting any errors but the files are not apperaring in ur Project means go to
    Step 2:
    From the work bench click
    Window -> Reposiroy Explorer -> Select the Project,edition,package or type and right click and from the pop up menu click "Add to Workspace"
    This 'd work
    All the best for a successful completion of ur work
    Pramod

  • 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 existing jsp file to a project?

    I am trying out 10g developer preview. Looks like a lot of bugs are there in the tool. I would like to know how to add existing jsp file into a project. I tried the Import functionality, but it shows the option to create a project and include only Java files. Is there a way to do this? Thank you

    Just copy the files in the directory where the rest of your source file is.

  • How to add new music files in Hp connecterd music

    I am new to HP connected music.  I want to understand the following
    a)  Where does HP connected music app look for music in our computer.  I want to know the location of folders.
    b) How to add new music files into playlists
    can anyone help please.
    RAVIKUMAR RT

    Hi @rtravikumar 
    I see you are looking for some help with HP Connected Music.  I did a little bit of searching and found the following pages that should be useful to you.
    HP Connected Music Powered by Meridian (Windows 8)
    HP Connected Music FAQ
    I hope this helps.
    Malygris1
    I work on behalf of HP
    Please click Accept as Solution if you feel my post solved your issue, it will help others find the solution.
    Click Kudos Thumbs Up on the right to say “Thanks” for helping!

  • 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

  • How to add more disk space into /   root file system

    Hi All,
    Linux  2.6.18-128
    can anyone please let us know how to add more disk space into "/" root file system.
    i have added new hard disk with space of 20GB, 
    [root@rac2 shm]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda1             965M  767M  149M  84% /
    /dev/hda7             1.9G  234M  1.6G  13% /var
    /dev/hda6             2.9G   69M  2.7G   3% /tmp
    /dev/hda3             7.6G  4.2G  3.0G  59% /usr
    /dev/hda2              18G   12G  4.8G  71% /u01
    LABLE=/               2.0G     0  2.0G   0% /dev/shm
    /dev/hdb2             8.9G  149M  8.3G   2% /vm
    [root@rac2 shm]#

    Dude! wrote:
    I would actually question whether or not more disks increase the risk of a disk failure. One disk can break as likely as one of two of more disks.
    Simple stats.  Buying 2 lottery tickets instead of one, gives you 2 chances to win the lottery prize. Not 1. Even though the odds of winning per ticket remains unchanged.
    2 disks buy you 2 tickets in The-Drive-Failure lottery.
    Back in the 90's, BT (British Telecom) had a 80+ node OPS cluster build with Pyramid MPP hardware. They had a dedicated store of scsi disks for replacing failed disks - as there were disk failure fairly often due to the number of disks. (a Pryamid MPP chassis looked like a Xmas tree with all the scsi drive LEDs, and BT had several)
    In my experience - one should rather expect a drive failure sooner, than later. And have some kind of contingency plan in place to recover from the failure.
    The use of symbolic links instead of striping the filesystem protects from the complete loss of the enchilada if a volume member fails, but it does not reduce the risk of loosing data.
    I would rather buy a single ticket for the drive failure lottery for a root drive, than 2 tickets in this case. And using symbolic links to "offload" non-critical files to the 2nd drive means that its lottery ticket prize is not a non-bootable server due to a toasted root drive.

Maybe you are looking for

  • No longer able to use hotmail on windows 98, firefox 2.0.0.20

    Using Hotmail I can't reply to messages nor create new ones. I'm on windows 98SE and use firefox 2.0.0.20. A new problem with some changes Microsoft made to Hotmail. == URL of affected sites == http://hotmail.com

  • User control for Webservices

    Hi Experts i am working on PI 7.1 ..i have a soap to abap proxy scanrio..i published my services in SR ..say i gave the WSDL to 3 partners and they also have the USer ID and PWd ...to send message to the PI system..but now i want one 2 of them to be

  • Table data element related

    Hi , i want to create one field in table which must contain  value  range between -1000 to 1000 through SM30. i will have to do some arithmatic operation on it through another program.what type of domain i should define while creating table.can u plz

  • IPad 2 says it's in 'recovery mode' after latest update??

    iTunes wants to restore my iPad to factory settings after trying to do an update, I don't want to lose everything on it, please help?

  • To install Xcode do you have to buy the newest version of OS?

    I'm in a computer class and I need a C++ compiler for my mac. I tried to download Xcode, but to run it it said I needed an updated version of OS. I was wondering if I have to buy the version just to run Xcode or if there is any other way to get it to