Displaying Styled HTML in a frame

Hi. I'm not sure if this is the right forum to go to, but anyway.
I have a styled html page. And with styled, I mean I'm using a css stylesheet on it. I want to display this page inside a JFrame. This is supposedlly easy and uncomplicated according to suns javadoc. I can choose to use either a JEditorPane or a JTextPane. Set the content type and use the .setPage method to load the url of the page to be displayed. The page is displayed, but without any styling.
I've tried to have the stylesheet inside the html document, and as a linked reference. But the same result is displayed. Everything within the <STYLE> tags are displayed as standard text (not very attractive).
Is there something I'm missing? Do I have to make my own HTML parser to do this job? The HTML viewer in JDeveloper shows my page nicelly. What can be done?
Please reply to: mailto:[email protected]
Thanx

Is there something I'm missing? Do I have to make my own HTML parser to do this job? The HTML viewer in JDeveloper shows my page nicelly. What can be done?We don't use the JEditorPane for displaying HTML, we licensed one for use inside of JDeveloper. Search on JARS.com, there's several out there, the JEditorPane implementation is ok for the basics, but can't handle the more advanced HTML (i.e. CSS, etc.)
Rob

Similar Messages

  • Display a document.html in a frame java

    how can I display a .html in a frame java ?
    could it be possible to obtain a object Graphics to put it then in the frame ?

    JEditorPane

  • To display an html page that contains frames, using servelt

    Hi all
    i am using a servlet which has to display a html page that contains frames.
    I would like to know whether it is possible to display a frame using servlets.
    If yes please tell me the how to do it?
    Thanks,
    Sudheer.

    Thanks Seth.
    I just tried that, but when I run it in preview mode (by simply hitting F12), it gives me an error because it can't  find the file in the temporary preview folder it creates (ie:
    C:\Users\Tom\AppData\Local\Temp\CP2840464090993Session\CPTrustFolder2840464091009\Captivat ePreviewLoader\
    I'm hoping to find a place to put it so that it works when running F12 and when running in regular 'published' mode
    I was thinking I could put it in the 'C:\Program Files\Adobe\Adobe Captivate 6 (32 Bit)\Templates\Publish' folder, but when I do that, it doesn't seem to gete copied to the .\CaptivatePreviewLoader folder when running F12

  • How to send HTML to a frame

    I want to know how to send and HTML page generated by a servlet into a specific frame of the client browser.

    If you are sending the data to the servlet using a form tag, just specify the target inside the form tag and your servlet will display the output in that frame.

  • Displaying images in an application frame

    I'm trying to display a .gif in a frame. The first challenge is to turn the file(local) into an Image class. I don't know how to do that. Second is taking that Image and using Graphics to draw it. Alas, made necessary are "ImageObserver", "ImagerConsumer", "ImageProducer" and other such nonsensical classes. I've spent quite some time trying to figure this out
    I feel bad wasting a post on something like this, but it seems to me like a valid question. It even says in the O'Reilly's Java in a Nutshell that images in Java are confusing. If there are links to good tutorials, or someone could post code for a simple Frame with a Graphics object that displays a .gif image from the same directory as the class I would appreciate it greatly.

    I'm not sure why "Java in a nutshell" would say it's complex or confusing. But then that's the only O'Reilly book I've bought and didn't like. I prefer Bruce Eckel's "Thinking In Java"
    In any case, let's look at images:
    First, reference the "How to use Images" sectin of the Java Tutorial at http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html
    The way I'd do it is to construct an ImageIcon class using
    public ImageIcon(String filename)
    Now, ImageIcon and Image are not derived from Component, so you can't put them into a Frame. BUT, you can put a JLable into a JFrame and the JLable can have an image. So you construct a new JLable like this:
    ImageIcon myIcon = new ImageIcon("/images/duke.gif")
    JLabel myLabel = new JLabel(myIcon);
    Then put myLabel into your JFrame
    myJFrame.getContentPane().add(myLabel);
    (or put it in whatever layout manager and panel you are using within yoru JFrame)
    That should do it. If you're going to be putting your code into a jar file then there is an additional bit of code that needs to be added. If you search for "Images jar" you'll find lots of discussion. Or you could go to my site at www.brouelette.com and look at the code for "One Hour Wumpus" to see the ImageLoader that I use that works in or out of a jar file.
    Good luck.

  • Want to open a new browser window and display the html file in locale disk.

    Hi,
    I want to open a new browser window and display the html file in local drive. The below html applet work in local system successfully. But i deploy the same in web server (Tomcat) and try the same in client machine it does not work. Please help.
    Note:
    The class below fileopen.FileOpen.class i make it as a jar and put it in jre\ext folder at the client machine.
    ------------------------------------FileOpen.html(Tomcat)-----------------------------------------------------
    <html>
    <body >
    <applet code="OpenFile.class" archive="loadfile.jar" width="100" height="100">
    <param name="path" value="file://c:/open.html" />
    </applet>
    </body>
    </html>
    -------------OpenFile.java in server(Tomcat)--------------------------------------------
    public class OpenFile extends Applet implements ActionListener{
    String path = "";
    fileopen.FileOpen open = null;
    Button b = null;
    public void init(){
    path = getParameter("path");
    b = new Button("Open");
    b.addActionListener(this);
    add(b);
    public void actionPerformed(ActionEvent ae){
    try
    open = new fileopen.FileOpen(this,path);
    catch (Exception e){
    e.printStackTrace();
    -------------------------------------------FileOpen.java /Client JRE/ext----------------------------------------------------
    package fileopen;
    public class FileOpen
    AppletContext context = null;
    URL url = null;
    public FileOpen(Applet applet,String path)
    try
    if(null != applet){
    context = applet.getAppletContext();
    if (null != path)
    url = new URL(path);
    context.showDocument(url, "_blank");
    }catch(Exception ex)
    ex.printStackTrace();
    Please help to solve this issue very urgent.
    Thanks in advance.
    By,
    Saravanan.K.

    zzsara wrote:
    I want to open a new browser window and display the html file in local drive. ...Did you ever pause to consider how ridiculous that is?
    The best audience for applets is people off the internet. 'People off the internet' might be using a computer that has no (what was it?) 'open.html' in the root of the C: drive. In fact (shock horror) they may not even be running Windows, and would therefore probably have no 'C:' drive at all.
    If you do not intend to distribute this to people off the web, an application makes a lot more sense, but even then, you cannot rely on the document being there unless you 'put it there' (during installation, for instance).
    As the other poster intimated, applets can load documents off the local disk as long as they are trusted. Here is an example*, but note that it is not so rash as to presume any particular path or file, and instead leaves it to the user to choose the document to display.
    * The short code can be seen at SDNShare on the [Defensive Loading of Trusted Applets|http://sdnshare.sun.com/view.jsp?id=2315] post.
    On the other hand, a sandboxed applet can load any document coming from its own server via URL, or get showDocument(URL) to work. In that case, the JRE must recognize that the URL is from its own server, so the best way to form URLs for applet use is via the URL constructor
    new URL(getDocumentBase(), "path/to/open.html");That is how I form the URL in this [ sandboxed example of formatting source|http://pscode.org/fmt/sbx.html?url=/jh%2FHelpSetter.java&col=2&fnt=2&tab=2&ln=0]. Of course, in this case the applet loads the document, then parses the text to draw the formatted version, but the point is that an URL produced this way will work with showDocument(URL).
    I am pretty sure showDocument() in an applet off the internet will work with an URL pointing to a foreign (not its own) server, but it will not be able to load documents off the end user's local disks.
    I suggest a couple of things.
    - Try to express this problem in terms of what feature it is that you want to offer the end user. Your question jumps directly to a bad strategy for achieving ..who knows what? An example of a feature is "Shows the applet 'help' files on pressing F1".
    - A good way to indicate interest in a solution is to offer [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview] to match that interest.
    Edit 1:
    ..and please figure out how to use the CODE tags.
    Edited by: AndrewThompson64 on Sep 12, 2008 11:14 PM

  • How can I display the HTML page from servlet which is called by an applet

    How can I display the HTML page from servlet which is called by an
    applet using the doPost method. If I print the response i can able to see the html document. How I can display it in the browser.
    I am calling my struts action class from the applet. I want to show the response in the same browser.
    Code samples will be appreciated.

    hi
    I got one way for this .
    call a javascript in showDocument() to submit the form

  • Most, but not all, website no longer display as HTML. This has been happening since I downloaded the latest version of Firefox.

    The websites are accessible but do not display as HTML. Mirriam-Webster is one such site, but there are many others. However, this Firefox site and my google mail site, as well as some others, display fine.
    I've pasted in an example of a website that will not display properly on Firefox but displays just fine on Internet Explorer.

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • How to display an HTML file in text Area?

    I am trying to display an HTML formated file in  text area component using Action 3.0. The following script does not generates compiler errors, each function seems to be executed yet the file is not displayed. When trying the same code with myCV.txt and myCV_TA.text = (loader1.data) the text file is displayed OK. Flash MX and actionscript 2.0 had handled that differently but with success???
    ( myCV_TA is the text area component)
    Thanks
    var loader1:URLLoader =new URLLoader();
    loader1.addEventListener(Event.COMPLETE,displayText);
    textload("myCV.html");
    function textload(file:String)
    loader1.load(new URLRequest(file));
    trace("in textload");
    function displayText(e:Event)
    myCV_TA.htmlText = (loader1.data);
    trace("in displaytext");

    hmm.. never tried to use an .html file like that in flash, what's inside that file? text with images tables and so on? the htmltext property supports only a few HTML tags, maybe it's not working because an unsupported tag has been detected.

  • How to display an html located in server to client browser?

    Hi,
    i want to display an html file located at the server to a client browser. how can i do it? and i want the user to select the particular file thru an open dialog box. will it be possible?
    regds,
    Abhi...

    in general about files :
    http://forum.java.sun.com/thread.jsp?forum=45&thread=522723&start=0&range=15#2502318
    simple for html: soemdecription

  • How to display a html file without tags?

    Hello,
    I am new for Java programming. Now i have to display a html file without all the tags. My code is the fllowing:
    u = new URL("http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=protein&val=55584070");
    BufferedReader in = new BufferedReader(new InputStreamReader(u.openStream()));
    while ((s = in.readLine()) != null) {
    System.out.println(s);
    in.close();
    Unforturnately, the output is the soucecode of the html file and I just want the content.
    Please help me.
    Thanks a lot in advance,
    Danica

    Here's a simple example
    http://forum.java.sun.com/thread.jspa?threadID=293830
    I haven't tested it, but I bet camickr did.

  • How to display the HTML File Titles instead of File Names

    Hello All,
    I want to display the HTML file titles instead of File names in the Search Results. I've tried to give this command in the 'Visible Properties' in the 'SearchResourceRenderer' as:-
    Visible Properties: rnd:displayTitle
    However this is not working for me. If anyone has an idea of what to pass here or any other alternative to display the Titles.
    Regards
    Vaib

    Summary of steps:
    1) Standard Layout Set used: SearchResultLayoutSet
    2) Create a new layout set using ADVANCED COPY
    3) Change properties as you require
    4) Next modify the search OTH file to reflect this newly created Layout Set (under KM > root > etc > oth > search.oth edit xml file property rndLaoutSet from SearchResultLayoutSet to MyCustomSearchResultLayoutSet)
    5) Check in the document to complete the editing process if Edit Locally is used!
    6) Lastly, activate the OTH file by –
    •     Setting Debugging settings via Debugging Settings
    •     Performing a normal search
    •     Clicking Rendering information and then following link OTH Overview click on Reload
    7) Reload above reloads the OTH file and performing search again will yield the desired result
    8) To turn off the Rendering Information link remove the user id from Debugging Settings.
    Cheers
    Ankit

  • HT1688 I need a Front LCD Display Screen Touch Digitizer Assembly Frame for Iphone 4S Black, where can i buy it ? can i it by website? what ? thanks

    I need a Front LCD Display Screen Touch Digitizer Assembly Frame for Iphone 4S Black, where can i buy it ? can i it by website? what ? thanks

    Anywhere you can find it via the obvious Google search. It won't be from Apple, but will be a generic replacement.
    Why are you throwing away any future chances of out of warranty replacements when you drop or drown it?  Apple will give you a warranteed replacement phone for $199 (in the US, roughly the same in your country)

  • I want to display a HTML file that is stored locally on my machine.

    Hello,
    I am having a problem with my paths (I believe). I have created a JEditorPane that reads in a HTLM page. If the page is form the web it works fine:
    page_jep.setPage("http://www.google.com");However I want to display a HTML file that is stored locally on my machine.
    I have tried the following but cant get it to find the stored page:
    page_jep.setPage("file:///index.htm");
    java.io.FileNotFoundException: \index.htm (The system cannot find the file specified)I have tried putting the index file in both the root directory ( C ) and also the same place as where the class files are.
    Any help will be gratefully received,
    Harold Clements

    Nope, I have tried it:
    page_jep.setPage("file://c:\\index.htm");Gives me:
    java.net.UnknownHostException: c

  • Is there a way to display external HTML content inside a SWF movie?

    IE if i wanted to have an 800x600 flash movie that i could display cnn.com or something of that sort.  Is it possible?

    A second option is to display the HTML content over the top of the Flash content.
    If is project is to be displayed as a Web page... it's all HTML anyway.... some of which may be Flash content, some that is regular HTML content. So it's not that hard to add in a little more regular HTML content.
    In your Flash movie, leave a blank space with the exact dimensions/location of the HTML content you want to display.
    Then using HTML/CSS z-indexing, stack the HTML content over the top of that blank space... making it LOOK like the HTML is a part of the Flash.
    If you want to display part of another Web site like cnn.com, you could do that in an iframe.
    Z-indexing info here:
    http://www.w3schools.com/cssref/pr_pos_z-index.asp
    http://webdesign.about.com/cs/css/a/aazindex.htm
    and the iframe here:
    http://www.w3schools.com/tags/tag_iframe.asp
    Best wishes,
    Adninjastrator

Maybe you are looking for