Rendering html in JEditorPane

hi
i have a problem in JEditorPane.
when i rendering a html with frameset then i cannt resize the frames (like JSplitPane) but it working in browser.
so how i do it in JEditorpane??
thanks

I think it just ignores it, but I could be wrong. If you want to do what you are saying, I think you need some custom document or something. The standard classes aren't going to help much, as far as I can tell.

Similar Messages

  • Problem to display Animated Gif from HTML into JEditorPane

    I have a problem displaying animated gif that comes from URL (HTML) into JEditorPane.
    Let me show you the source I have:
    * @author Dobromir Gospodinov
    * @version 1.0
    * Date: Dec 6, 2002
    * Time: 6:47:53 PM
    package test.advertserver;
    import javax.swing.*;
    import java.awt.*;
    import java.io.IOException;
    public class Test {
         public static void main(String[] args) {
              JFrame frame = new JFrame();
              JEditorPane ed = new JEditorPane();
              try {
                   ed.setPage("http://localhost:8200/servlet?key=value");
              } catch (IOException e) {
                   e.printStackTrace();
              JPanel panel = new JPanel();
              panel.setPreferredSize(new Dimension(500, 500));
              panel.add(ed);
              frame.getContentPane().add(panel);
              frame.pack();
              frame.setVisible(true);
    }Part of the returned from servlet HTML includes an img tag:
    <img src="/images/MyAnimatedGif.gif" alt="animated gif comment" width="480" height="50"  border="0">Let us assume that MyAnimatedGif.gif has 10 frames and gif is looped - when the 10th is dipslayed it has to display the 1st and so on.
    JEditorPane displays frames from 1 to 10 correctly but does not start from the first again. Instead JEditorPane displays a broken image.
    I locate where the problem arise:
    JEditorPane has an HTMLEditorKit that creates javax.swing.text.html.ImageView instance for every IMG tag.
    And here is the problem:
    ImageView has an ImageObserver necessary for the asynchronous image download. ImageObserver has the imageUpdate method. But this imageUpdate method is never called with ALLBITS flag raised up. Instead, after the last frame of MyAnimatedGif.gif is downloaded the imageUpdate method is called with flag ERROR raised up. Obviously this is a bug of Sun's implementation. Finaly the flag ALLBITS has to be received for normal end of image observing. But ALLBITS flag does not come.
    So, can anybody help me how to load an animated gif within JEditorPane completely.
    Thank You in advance,
    Dobromir Gospodinov
    P.S. If somebody of you wants to debbug what happens within ImageView will have to implement it (and related classes too, because of the limited package visability) borrowing the source from Sun's ImageView.

    I'm also having this problem with java 1.4.1 I discovered that some animated gifs work fine, while others stop animating. Running with java 1.3.1 fixed the problem. I'm going to report this as a bug
    Here's my code:
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    public class AnimatedGifTester
    extends JFrame
    public static void main(String argv[])
    throws Exception
    new AnimatedGifTester();
    public AnimatedGifTester()
    throws Exception
    String[] images = new String[] {
    "http://www.gif.com/ImageGallery/Animated/Animals/Photographic/dog_running.gif",
    "http://www.gif.com/ImageGallery/Animated/Characters/Cartoon/java.gif",
    "http://www.webdeveloper.com/animations/bnifiles/anielg.gif",
    "http://www.webdeveloper.com/animations/bnifiles/cat2.gif",
    "http://images.animfactory.com/animations/animals/fish/big_fish_swimming_md_wht.gif",
    "http://www.webgenies.co.uk/images/martian.gif",
    "http://www.webdeveloper.com/animations/bnifiles/at_sign_rotating.gif",
    "http://www.webdeveloper.com/animations/bnifiles/arrow_1.gif",
    "http://www.gif.com/ImageGallery/Animated/Characters/Cartoon/javaacro.gif",
    "http://java.sun.com/products/java-media/2D/samples/suite/Image/duke.running.gif",
    "http://www.gif.com/ImageGallery/Animated/SouthPark/Cartoon/stan.gif"
    StringBuffer buffer = new StringBuffer("<html><body>");
    for (int idx = 0; idx < images.length; idx++)
    buffer.append("<img src='" + images[idx] + "'>");
    buffer.append("</body></html>");
    String html = buffer.toString();
    // save a copy of the html to open in a browser so we can see what it's
    // supposed to look like
    BufferedWriter writer = new BufferedWriter(new FileWriter("animatedGifTest.html"));
    writer.write(html);
    writer.close();
    JEditorPane editorPane = new JEditorPane("text/html", html);
    editorPane.setEditable(false);
    getContentPane().add(editorPane);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setSize(new Dimension(400, 600));
    show();

  • Set DOCTYPE for a self rendered HTML page using cl_gui_html_viewer

    G'Day!
    I'm dealing with HTML in ABAP and i' stuck with a nasty little problem. Perhaps somebody know's the answer and can help me out. Thanks in advance. (I'm sorry for my poor english)
    My problem is:
    I am rendering a html page in abap and display ist using a cl_gui_html_viewer.
    Works fine.
    But now in need to set the right DOCTYPE for the rendered html page.
    If i add the DOCTYPE definition, my html page is not displayed, instead i get a display of the html-code??
    To break it down to the root:
    How can i add the DOCTYPE definition to a self-rendered html page?
    If i add the DOCTYPE definition as first element of my html table, the html code won't be interpreted.
    If i do not add the DOCTYPE defintion everything works fine.
    I need the DOCTYPE definition so that the browser won't get into quirks mode and interpretes the html tag's right.
    What i've done so far:
    (Dynpro, container, html_viewer)
    Load my JScripts (with load_mime_object)
    Load my CSS (with load_mime_object)
    Load my HTML:
    -- lt_html       TYPE w3htmltab
    ((--  APPEND  '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">'  TO ct_html.)) this line cause my trouble
    -- filled the itab with my html tags <html>....</html> (set right url for Jscript and CSS)
    -- Load my html table and get an URL CALL METHOD gr_labform_html->load_data
    -- Load the url CALL METHOD gr_labform_html->show_url

    I've "solved" my issue with a little workaround.
    I created an empty html page with an existing DOCTYPE def and an tag like <!MYDATA!>
    After that i filled 'l_merge_table TYPE swww_t_merge_table' with my tag and my html_data.
    Loaded the whole thing with CALL METHOD gr_labform_html->load_html_document and now the DOCTYPE is set fully correct!
    But i'm still interessted why i can't set the DOCTYPE directly? Anybody knows?
    Got the idea from: Re: How can I read color from frond-end PC

  • Display HTML in JEditorPane

    Hi
    I am trying to display a String containing HTML text on a JEditorPane.
    I have downloaded the HTML from a webpage using sockets, and now I want to display the downloaded page. I have a project in school about sockets.
    This is why I can't use getPage(URL);
    The following is the code I am using:
    String temp = "String with HTML text"
    HTMLEditorKit htmlEdKit = new HTMLEditorKit();
    JEditorPane.setEditorKit(htmlEdKit);
    JEditorPane.setContentType("text/html");
    JEditorPane.setEditorKitForContentType("text/html", htmlEdKit);
    JEditorPane.setContentType("text");
    JEditorPane.setText(temp);
    When I run the code, all that is displaying is the raw HTML code, with all the tags. As I understand it, this is how it should be done.
    What is wrong, would appreciate some help.
    /David Mossberg

    it's not necessary to use socket but if use socket get the inputstream from it.
    in = socket.getinputstream(); //return inputstream from socket
    htmldoc = JEditorPane.getDocument(); //return the htmldoc in JEditorPane
    if(htmldoc.getlength()>0)
    htmldoc.remove(0,htmlDoc.getLength());//if the htmldoc has some content then remove it
    reader = new InputStreamReader(in);//construct a new reader from in
    JEditorPane.getEditorKit.read(reader,htmldoc,0); //read new content into the htmldoc from reader
    Hope the above code helps you.
    joney

  • Rendered html pages in results file(html) not showing the images of origina

    hi,
    rendered html pages in results file(html) not showing the images of original page
    when i click on rendered html pages of different html section of a results file.
    both master and tested as well.
    thx
    pasumarthi

    By design, the report will not show the images, will not apply imported css or javascript files and will not show framesets. Also, in the case that an image is shown there is no guarantee that that was the image that was seen when recording/playback the script.
    The rendered html pages that are shown in the report only contains the structure of the html page. If an image is shown the image will be a reference to the location of the image and not a saved copy of the image as part of the report. If the website has a simple structure this can give an idea of what was different. If the website relies extensively on images, stylesheets or javascript to present the information then this report feature becomes less useful.
    Few weeks ago I requested a feature request in order to be able to see in the report the page exactly as it was when recording the script and exactly as it was when the script was played back. In the way that the feature request was written it specifies the use of screen captures or saving the page as a pdf file.
    Regards,
    Zuriel

  • Bug in rendering  HTML content Apex 2.2 (in Apex 2.0 was OK)

    We have many PLSQL processes which are called through boolean function which return some message as well as the result.
    <br>
    function some_func (pid IN NUMBER,err_msg OUT NOCOPY VARCHAR2) RETURN BOOLEAN;<br>
    and at the end function looks like:
    <br>
      :err_msg := 'Pitanje <*b>'||TO_CHAR(p_id)||'<*/b> je OK!';
      RETURN TRUE;<br>
    Later, in "On load before header", we call this function and assign "err_msg" value to hidden item "P2_MESSAGE", placed on the same page. Assigment is done in an way like:
    <br>
      some_bool:=some_func (:P2_ID,:P2_MESSAGE);<br>
    In one HTML reagion, we put in "Source", code like:
    <br>
    <*class="t16dataalt">&P2_MESSAGE.</class><br>
    and until now, bold tags are applied as well as class-we get only text!
    <br>
    But now, in Apex 2.2, (original theme 16 used) in result we get all content as it is not recognized as HTML code.
    <br>
    In browser the result(in a case of OK result) is:
    <br>
    Pitanje <*b>1<*/b> je OK!<br>
    and the generated source is:
    <br>
    <*class="*t16dataalt">Pitanje &*lt;*b&*gt;1&*lt;/b&*gt; je OK!</*class="*t16dataalt"><br>
    Is that a bug or what?
    <br>
    Once more, before the same code was working nice, theme 2 used...
    <br>
    THX!
    <br>
    P.S
    <br>
    "*" is added to be read clearly!
    <br>
    P.S II
    <br>
    We have imported app that was exported on Apex 2.0 and the same problem occure!
    <br>
    So we think this is a bug in rendering HTML region!
    <br>
    Is there any hint to overcome that until patch come ?
    Message was edited by:
    Funky

    The issue is easy to reproduce. Create HTML region:
    User Interface Template-Reports Region
    Display point-Page template body
    Assign one hiden item in on load process with value:
    P2_MESSAGE := "< b>OK</ b<>";
    Put P2_MESSAGE in HTML Source with content like this:
    < class="t16dataalt">&P2_MESSAGE.</ class>
    and you have it!

  • Sharepoint online multiline list colomn not rendering HTML out put

    Hi 
    I have list with multi line column with having multimedia options. my problem is i have created view and edited XSL  to format it. also i have added "escape out put =yes" for the column but no luck still column is rendering as HTML Tags witch
    is not rendering HTML formats in UI
    Following is my code for List view any help greatly appreciate.. 
    regards
    Radika
    <%@ Page language="C#" MasterPageFile="~masterurl/default.master"    Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=16.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document"
    meta:webpartpageexpansion="full"  %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities"
    Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI,
    Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral,
    PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="ApplicationPages" Namespace="Microsoft.SharePoint.ApplicationPages.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
    <SharePoint:ListProperty Property="TitleOrFolder" runat="server"/> - 
    <SharePoint:ListProperty Property="CurrentViewTitle" runat="server"/></asp:Content>
    <asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
    <SharePoint:RssLink runat="server"/>
    </asp:content>
    <asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server">
    <SharePoint:ViewIcon Width="145" Height="54" runat="server"/></asp:Content>
    <asp:Content ContentPlaceHolderId="PlaceHolderLeftActions" runat="server">
    <SharePoint:RecentChangesMenu runat="server" id="RecentChanges"/>
    <SharePoint:ModifySettingsLink runat="server"/>
    </asp:Content>
    <asp:Content ContentPlaceHolderId ="PlaceHolderBodyLeftBorder" runat="server">
    <div height="100%" class="ms-pagemargin"><img src="/_layouts/15/images/blank.gif?rev=37" width='6' height='1' alt="" data-accessibility-nocheck="true"/></div>
    </asp:Content>
    <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
    <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate>
    <WebPartPages:XsltListViewWebPart runat="server" ViewFlag="" ViewSelectorFetchAsync="False" InplaceSearchEnabled="True" ServerRender="False" ClientRender="False"
    InitialAsyncDataFetch="False" WebId="00000000-0000-0000-0000-000000000000" IsClientRender="False" GhostedXslLink="main.xsl" ViewGuid="{D63D68ED-17D1-4CC9-BCF6-20DFED0FB269}" EnableOriginalValue="False"
    DisplayName="NewsDisplay" ViewContentTypeId="0x" ListName="{17179938-EFC8-4DFE-92E9-CDE296D46919}" ListId="17179938-efc8-4dfe-92e9-cde296d46919" PageSize="-1" UseSQLDataSourcePaging="True" DataSourceID=""
    ShowWithSampleData="False" AsyncRefresh="False" ManualRefresh="False" AutoRefresh="False" AutoRefreshInterval="60" Title="CT_RSSFeeds" FrameType="Default" SuppressWebPartChrome="False"
    Description="" IsIncluded="True" PartOrder="2" FrameState="Normal" AllowRemove="True" AllowZoneChange="True" AllowMinimize="True" AllowConnect="True" AllowEdit="True"
    AllowHide="True" IsVisible="True" TitleUrl="/sites/EFLDEV/Lists/CT_RSSFeeds" DetailLink="/sites/EFLDEV/Lists/CT_RSSFeeds" HelpLink="" HelpMode="Modeless" Dir="Default" PartImageSmall=""
    MissingAssembly="Cannot import this Web Part." PartImageLarge="" IsIncludedFilter="" ExportControlledProperties="False" ConnectionID="00000000-0000-0000-0000-000000000000" ID="g_d63d68ed_17d1_4cc9_bcf6_20dfed0fb269"
    ExportMode="NonSensitiveData" __MarkupType="vsattributemarkup" __WebPartId="{D63D68ED-17D1-4CC9-BCF6-20DFED0FB269}" __AllowXSLTEditing="true" __designer:CustomXsl="Fldtypes_mswhTitle.xsl;fldtypes_Ratings.xsl"
    WebPart="true" Height="" Width=""><ParameterBindings>
    <ParameterBinding Name="dvt_sortdir" Location="Postback;Connection"/>
    <ParameterBinding Name="dvt_sortfield" Location="Postback;Connection"/>
    <ParameterBinding Name="dvt_startposition" Location="Postback" DefaultValue=""/>
    <ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
    <ParameterBinding Name="OpenMenuKeyAccessible" Location="Resource(wss,OpenMenuKeyAccessible)" />
    <ParameterBinding Name="open_menu" Location="Resource(wss,open_menu)" />
    <ParameterBinding Name="select_deselect_all" Location="Resource(wss,select_deselect_all)" />
    <ParameterBinding Name="idPresEnabled" Location="Resource(wss,idPresEnabled)" />
    <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
    <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
    </ParameterBindings>
    <Xsl>
    <xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
    xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">     <xsl:output method="html" indent="no"/>     <xsl:decimal-format NaN=""/>  
      <xsl:param name="dvt_apos">&apos;</xsl:param>     <xsl:variable name="dvt_1_automode">0</xsl:variable>     <xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema"
    xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
            <xsl:call-template name="dvt_1"/>     </xsl:template>     
    <xsl:template name="dvt_1" ddwrt:ghost="" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:ddwrt2="urn:frontpage:internal">      
      <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>      
         <link rel="stylesheet" href="/sites/EFLDEV/Utillity/ES/page.css" type="text/css" media="screen" /> <link rel="stylesheet" href="/sites/EFLDEV/Utillity/ES/slider.css" type="text/css"
    media="screen" /> <script type="text/javascript" src="/sites/EFLDEV/Utillity/ES/jquery.easing.1.2.js"></script> <script src="/sites/EFLDEV/Utillity/ES/jquery.anythingslider.js" type="text/javascript"
    charset="utf-8"></script> <script type="text/javascript">         function formatText(index, panel) {           return index + &quot;&quot;;        
    }         $(function () {             $(&apos;.anythingSlider&apos;).anythingSlider({                 easing: &quot;easeInOutExpo&quot;,    
                autoPlay: true,                 delay: 3000,                 startStopped: false,                
    animationTime: 600,                 hashTags: true,                 buildNavigation: true,             pauseOnHover: true,        
    startText: &quot;Go&quot;,         stopText: &quot;Stop&quot;,     navigationFormatter: formatText             });             $(&quot;#slide-jump&quot;).click(function(){
                    $(&apos;.anythingSlider&apos;).anythingSlider(6);             });         });     </script> <div class="anythingSlider">
        <div class="wrapper">         <ul>         <xsl:call-template name="dvt_1.body">             <xsl:with-param name="Rows"
    select="$Rows" />             </xsl:call-template>         </ul>             </div>         </div>     </xsl:template>
        <xsl:template name="dvt_1.body">         <xsl:param name="Rows" />         <xsl:for-each select="$Rows">    
            <xsl:call-template name="dvt_1.rowview" />         </xsl:for-each>     </xsl:template>     
    <xsl:template name="dvt_1.rowview" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal">         <li>         <div class="textSlide">
    <!-- display the item title and a link to the item --><h3><a href="/{@FileDirRef}/DispForm.aspx?ID={@ID}" title="{@ItemTitle}"><xsl:value-of select="@ItemTitle" /></a></h3> <!-- display the
    body of the item  -->    <div><xsl:value-of select="@ItemDescription" disable-output-escaping="yes" /></div>     </div>     </li></xsl:template> 
    </xsl:stylesheet></Xsl>
    <DataFields>
    </DataFields>
    <XmlDefinition>
    <View Name="{D63D68ED-17D1-4CC9-BCF6-20DFED0FB269}" Type="HTML" DisplayName="NewsDisplay" Url="/sites/EFLDEV/Lists/CT_RSSFeeds/NewsDisplay.aspx" Level="1" BaseViewID="1"
    ContentTypeID="0x" ImageUrl="/_layouts/15/images/generic.png?rev=37" >
    <Query/>
    <ViewFields>
    <FieldRef Name="LinkTitle"/>
    <FieldRef Name="ChannelID"/>
    <FieldRef Name="Tag"/>
    <FieldRef Name="Created1"/>
    <FieldRef Name="ItemTitle"/>
    <FieldRef Name="ID"/>
    <FieldRef Name="ItemDescription"/>
    </ViewFields>
    <RowLimit Paged="TRUE">30</RowLimit>
    <Aggregations Value="Off"/>
    <JSLink>clienttemplates.js</JSLink>
    <XslLink Default="TRUE">main.xsl</XslLink>
    <Toolbar Type="Standard"/>
    </View>
    </XmlDefinition>
    </WebPartPages:XsltListViewWebPart>
    </ZoneTemplate></WebPartPages:WebPartZone>
    </asp:Content>
    <asp:Content ContentPlaceHolderId="PlaceHolderPageDescription" runat="server">
    <SharePoint:ListProperty CssClass="ms-listdescription" Property="Description" runat="server"/>
    </asp:Content>
    <asp:Content ContentPlaceHolderId="PlaceHolderCalendarNavigator" runat="server">
    <SharePoint:SPCalendarNavigator id="CalendarNavigatorId" runat="server"/>
      <ApplicationPages:CalendarAggregationPanel id="AggregationPanel" runat="server"/>
    </asp:Content>

    Hi,
    In SharePoint Online 2013, we can use jQuery to convert “&lt”  to “<” and  convert “&gt” to “>”.
    The following code for your reference:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
    $(".ms-rtestate-field").each(function(){
    var $this = $(this).find("p");
    if ($this.length>0) {
    $this.each(function(){
    $(this).html($(this).html().replace('&lt;', '<').replace('&gt;', '>'));
    </script>
    We can also use JSLink to customize the display view.
    http://code.msdn.microsoft.com/office/Client-side-rendering-JS-2ed3538a
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • How to modify rendered HTML dynamically

    Hi, I'm looking for a method to modify rendered HTML appearance at runtime. I.e. enabling/disabling a button according to some other condition. I can do it within the same page, by means of a valueChangeListener, then searching for the componennt id to enable/disable. But I cannot when coming from another page, since the involved lifecycle refers to this one. The target page is rendered at the end, and I would like to modify its button then. I guess I should influence the render response phase to enable/disable that button, but how ?

    You can use EL in the rendered or disabled attributes:
    <h:commandButton value="..." action="..." rendered="#{MyBean.shouldButtonBeRendered}" />
    <h:commandButton value="..." action="..." disabled="#{MyBean.shouldButtonBeDisabled}" />etc

  • HTML in JEditorPane question

    Hello
    I am having trouble with displaying HTML with image maps in JEditorPane component. I am trying to load a simple html file as follows:
    <html>
    <IMG SRC="monk.gif" HEIGHT="255" WIDTH="262" ISMAP USEMAP="#mapareas">
    <map NAME="mapareas">
    <area SHAPE=CIRCLE COORDS="107,158 132,162" HREF="basic.htm" ALT="Basic Page">
    <area SHAPE=default HREF="index.html">
    </MAP>
    </html>
    There is no problem with displaying the image. It's rendered fine without any problem. But, When I click on the circle area, I can't seem to get the URL corresponding to the map area. I tried the HyperlinkEvent::getDescription() and HyperlinkEvent::getURL() methods and both of them return the reference to the map as opposed to the reference specified for the specific map area ( in my case, "sample.map" instead of "basic.htm" ).
    Can someone tell me if HTML with image maps is supported in EditorPane? if so, how do I get the reference to the map area clicked?
    thanks in adv
    Venkat Kota

    JTextComponent.viewToModel
    then get the element at that location, either the character or
    paragraph element, then get its StyleContext.NameAttribute value, which is a HTML.Tag.
    That was a fun walk round the API, to find out more, I recomend reading through JTextComponent, and its Model/View Split section.
    The the Element and View interfaces.

  • JavaHelp not rendering HTML when run from Fatjar

    I'm experiencing a strange problem with JavaHelp: when I run my app from Eclipse and open JavaHelp, the html help pages render just fine. If I Fatjar the app and run it from the fatjar, however, then when I open the JavaHelp, my html help pages are displayed as raw text, HTML tags and all. For some reason it's not rendering the HTML. I'm guessing that maybe the fatjar is messing up the JEditorPane's ability to detect the content-type of the help pages, but I have no idea how to fix it if that's the case.
    I'm using a plain vanilla HelpSet file, pretty much straight out of the JavaHelp User's Guide.
    Anyone have any idea what might be causing this or how I might fix it/work around it? Has anyone else seen this problem before?

    For whatever it's worth, I am seeing this problem as well. It doesn't seem to have to do with FatJar, as I'm seeing it when I simply do the following:
        HelpSet helpSet = null;
        final ClassLoader cl = this.getClass().getClassLoader();
        try {
          helpSet = new HelpSet(null, HelpSet.findHelpSet(this.getClass().getClassLoader(), "IdeHelp.hs")); // XXX bogus for now
        } catch (final Exception kaboom) {
          helpSet = null;
        if (helpSet != null) {
          final HelpBroker helpBroker = helpSet.createHelpBroker();
          final ActionListener helpItemActionListener = new CSH.DisplayHelpFromSource(helpBroker);
          final JMenuItem primaryHelpItem = new JMenuItem("Help\u2026");
          primaryHelpItem.addActionListener(helpItemActionListener);
          helpMenu.add(primaryHelpItem);
        }I suspect it's a problem with the classloader, but I haven't dug to find out what exactly.
    Best,
    Laird

  • Problem rendering html in Apex 3.1

    I recently upgraded an older 2.0 app to Apex 3.1. In the app, I have a few textarea with html editor fields so the user can customize page instructions. In 2.0, I was able to query the database and store the text in a hidden item, then reference the value of that item in an html region for the text to render correctly. (EX: Region Header has a source of &P100_HEADER_TEXT.)
    Now, in Apex 3.1, this no longer works. Instead, it is showing all of the html tags. If I copy and paste the contents of the hidden value directly, the html is rendered. If I change the hidden item to display as text, it is formatted correctly, but the alignment I had set up previously is off.
    I have numerous regions like this and would like to avoid having to go through and reformat all my pages. Does anyone have any suggestions?
    Thanks!

    Hi Scott,
    Yes, I was able to get it to work by adjusting my item to display as text (does not save state). However, previously I was able to compute a hidden item and use the value of the item as the source of an html region, or header for any other region, and it would render correctly. So, if the value of item p100_directions was "Please enter all valid information" in bold, previously it would display in bold. After the upgrade, it would display with the html tags around it.
    I will workaround with the display as text functionality.
    Thanks!

  • Edit html in JEDITORPANE

    HEllo friends!
    I need your help, for editing html in editorpane.
    I want to create a textarea in which the user type simple text than select some part of it & makes it bold, italic etc. by using an event of button or popup any thing.
    So guide me that which textcomponent provide this , i already used JEditorPane, and insert tags manually but it is not good, if i try to overlap the tags og italic & bold.
    So please help me is this any way pre built to provide these func. of add html tags in jeditorpane & use see the render html test in area.
    than please provide me. at [email protected]
    Thanks
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax .swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.IOException;
    public class TestJEditor extends JFrame {
    Panel p1 = new Panel();
    JButton b1 = new JButton("BOLD");
    JButton b2 = new JButton("ITALIC");
    BorderLayout borderLayout1 = new BorderLayout();
    JScrollPane jScrollPane1 = new JScrollPane();
    JEditorPane jEditorPane1 = new JEditorPane();
    HTMLEditorKit editorKit = new HTMLEditorKit();
    DefaultEditorKit defaultKit = new DefaultEditorKit();
    public TestJEditor() {
    super("Note");
    this.getContentPane().add(p1);
    //jEditorPane1.setEditable(false);
    jEditorPane1.setEditorKit(editorKit);
    p1.setLayout(null);
    p1.add(jScrollPane1);
    jScrollPane1.setBounds(10, 10, 350, 100);
    jScrollPane1.getViewport().add(jEditorPane1, null);
    b1.setBounds(370, 10, 100, 20);
    p1.add(b1);
    b2.setBounds(370, 40, 100, 20);
    p1.add(b2);
    b1.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e)
         // jEditorPane1.setEditorKit(defaultKit);
         String str = jEditorPane1.getText();
         System.out.println(str);
         String temp = jEditorPane1.getSelectedText();
         if(temp.indexOf("<B>") != 0)
         int start = str.indexOf(temp);
         int end = start + temp.length();
         System.out.println("start "+start+" end "+end);
         str = str.substring(0,start)+"<B>"+str.substring(start,end)+"</B>"+str.substring(end);
         jEditorPane1.setText(str);
         //System.out.println(jEditorPane1.getText());
    b2.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e)
         String str = jEditorPane1.getText();
         System.out.println(str);
         String temp = jEditorPane1.getSelectedText();
         System.out.println("Italic");
         int start = str.indexOf(temp);
         int end = start + temp.length();
         str = str.substring(0,start)+"<I>"+str.substring(start,end)+"</I>"+str.substring(end);
         jEditorPane1.setText(str);
    public static void main(String[] args) {
    JFrame frame = new TestJEditor();
    frame.setSize(600,500);
    frame.addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent e)
    System.exit(0);
    //frame.pack();
    frame.show();
    }

    Hi kashif10,
    JEditorPane or JTextPane are the classes to use. You can have both bold and italic for a text portion.
    See http://java.sun.com/products/jfc/tsc/articles/ for an overview of articles covering the swing text package.
    Or try application SimplyHTML at http://www.lightdev.com/template.php4?id=3 it is open source and has a lot of documentation too.
    Ulrich

  • Displaying rendered HTML text in spry detail region

    Hi,
    I have just started to play around with DW CS3 & spry and
    love them!
    I have a Master/Detail spry going from my database, but am
    having a problem displaying the detail the way I need it. The mySQL
    field is a BLOB for some HTML formatted text (I get the text
    elsewhere using a Xinha textarea edit widget and load the the
    formatted HTML text into my db). For example, my string is
    "<h2>this test</h2><strong>xyz</strong>"
    which is loaded into my db. I am using the dreamweaver ADDT export
    XML functionality to generate my spry master/detail region.
    My detail region is displaying the correct html associated
    with the selected master table entry, but it's with the HTML tags,
    not rendered as HTML (I don't want to see
    <h2>title</h2>; I'd like to see title with <H2>
    formatting).
    It's much like what I think a RSS feed would be, but can't
    find a way just to get the html to render because I don't have the
    files externally to source an iframe or anything. (I tried a XLS
    fragment transformation, just putting the detail record field that
    I want in an XLS file, but that didn't do anything).
    Any kind of guidance, hint, point and laugh but then tell me,
    would be greatly appreciated. I also posted at first at ADDT and
    then General Dreamweaver because I didn't locate this forum in the
    Forum topic list, so when I did find this I thought this is
    obviously where I should have first posted - sorry if anyone has
    also been surfing around. Thanks so much so any info.

    Hi Don,
    Thanks so much for responding. I actually did do that, but it
    seems like I might be doing it in the wrong place. I tried it in
    the .js that I have in my header:
    var dsList = new Spry.Data.XMLDataSet("./export.php",
    "theSpecials/special",{sortOnLoad:"rating",sortOrderOnLoad:"ascending",distinctOnLoad:tru e});
    dsList.setColumnType("detail", "html");
    which didn't do it. I also tried it right in my detail
    display area:
    <div style="overflow:hidden; width: 400px;"
    spry:detailregion="dsList">
    <div> <!-- nested div for spry effect -->
    <div id="detailDisplay" style="width:380px; "> <!--
    spry:content="{detail}"> -->
    <script
    type="text/javascript">dsList.setColumnType("detail","html");</script>{dsList::detail}
    <!-- echo '{dsList::detail}' ; ?> -->
    </div> <!-- detailDisplay -->
    </div> <!-- outter div for spry effect -->
    <!-- spry detail region -->
    </div>
    Excuse the inline ugliness, will clean it up when it's
    functional. But that doesn't seem to do it either. I am storing
    that particular field as a blob in the mysql database, but I
    already tried making that a VARCHAR which had no effect either.
    Thanks so much for for the suggestion! Any other gems that I
    can try?
    Liz

  • Saving Rendered HTML in JTextPane as TIFF

    Can someone help me in getting started with some sample code that does the following?
    I would like to save the WYSIWYG Image of the HTML and graphics displayed by specifying a URL in a JTextPane or JEditorPane. I would like to save the resulting image as a TIFF.
    If anyone has any sample code that does this, I would appreciate it if you can share this or help me in getting started.
    Thanks
    Venkatt

    Hi,
    This problem can be reduced to the problem of saving the contents of any panel that derives from a JPanel or Canvas.
    See my webpage on:
    http://www.ida.liu.se/~perkr/awtcanvas.html
    to see how to achieve this effect on a java.awt.Canvas. The case for a JEditorPane is the same, the basic idea is to make the panel paint in a BufferedImage that you then save to the fileformat you want.
    To make it paint to an image you need to create a BufferedImage or RenderedImage instance of the same size as the panel whose content you wish to dump as an image file, see the following code snippet:
                  Rectangle r = panel.getBounds();
                  Image image = panel.createImage(r.width, r.height);
                  Graphics g = image.getGraphics();
                  panel.paint(g);
                  ImageIO.write((RenderedImage)image, "png", new File(name));where "panel" referes to the JEditorpane. Note that the example uses the PNG format. I am not sure if default Java installations support TIFF yet (you can try) but I do know there exists a Java Advanced Imaging API (JAI) supplied by Sun that do support it.
    Hope this helps.
    /Per-Ola

  • Safari 2.0 not rendering HTML properly

    I have been having trouble with safari rendering pages since upgrading to 10.4 (still happening on 10.4.2)
    on most pages (not apple.com conveniently) the vertical spacing is not renederd properly, and there are huge gaps between items on the page.
    here is a jpeg that will show the problem in safari compared to firefox
    http://www.danyul.com/pics/safariRender.jpg
    Any help appreciated.
    thanks
    daniel

    I think i has something to do with an html table not having a fixed height determined by content.
    It even happens when i create a page in dreamweaver and test it in safari.
    here is a simple page created using this code:
    http://www.danyul.com/pics/safariRender2.jpg
    <html>
    <body>
    <table width="100%" border="1" cellspacing="0" cellpadding="0">
    <tr>
    <td>First <td>
    </td>
    </tr>
    <tr>
    <td>Second <td> </td>
    </tr>
    <tr>
    <td>Third <td> </td>
    </tr>
    </table>
    </body>
    </html>
    I have a powerbook too that was upgraded to 10.4 at the same time, and there are no problems rendering the html in safari on there...just here on the G5
    thanks
    daniel

Maybe you are looking for