TableCellRenderer with JTextPane and HTML

I'm writing a TableCellRenderer that will be rendering HTML content using a custom extension to the JTextPane class. Where I'm having trouble is in calculating the necessary height to set the table row based on the content of the cell (in this case HTML text in my JTextPane component). I know the width of the table cell and I can figure out the width of the content (taking into account the formatting because of the HTML content). This all works perfectly until the column width shrinks enough to cause the underlying view to word wrap.
Here is the code snippet from my JTextPane to count the number of lines of text and calculate the width of the content
  public int getWidthOfContent() {
    getLineCount();
    return m_iWidthOfContent;
  public int getWidthOfContent(int p_iWidthOfArea) {
    getLineCount(p_iWidthOfArea);
    return m_iWidthOfContent;
  public int getLineCount(int iComponentWidth) {
    int iWidth = 0;
    int iBreakCount = 0;
    int iHardBreakCount = 0;
    int iTotalWidth = 0;
    int iTotalContentWidth = 0;
    int iMaxHeight = 0;
    Document doc = getDocument();
    ElementIterator it = new ElementIterator(doc.getDefaultRootElement());
    StyleSheet styleSheet = null;
    if(doc instanceof HTMLDocument) {
      styleSheet = ((HTMLDocument)doc).getStyleSheet();
    if(iComponentWidth == -1) {
      iWidth = getWidth();
    else {
      iWidth = iComponentWidth;
    Element e;
    while ((e=it.next()) != null) {
      AttributeSet attributes = e.getAttributes();
      Enumeration enumeration = attributes.getAttributeNames();
      boolean bBreakDetected = false;
      while(enumeration.hasMoreElements()) {
        Object objName = enumeration.nextElement();
        Object objAttr = attributes.getAttribute(objName);
        if(objAttr instanceof HTML.Tag) {
          HTML.Tag tag = (HTML.Tag)objAttr;
//          if(tag == HTML.Tag.BODY) {
//            UCSParagraphView pv = new UCSParagraphView(e);
//            if(pv.willWidthBreakView(iWidth)) {
//              iHardBreakCount++;
          FontMetrics fontMetrics = null;
          if(styleSheet != null && styleSheet.getFont(attributes) != null) {
            fontMetrics = getFontMetrics(styleSheet.getFont(attributes));
          if(fontMetrics != null && fontMetrics.getHeight() > iMaxHeight) {
            iMaxHeight = fontMetrics.getHeight();
          if(tag.breaksFlow()) {
            //This must be a breaking tag....this will add another line to the count
            bBreakDetected = true;
            if(tag.equals(HTML.Tag.BR) || tag.isBlock() && (!tag.equals(HTML.Tag.HEAD) && !tag.equals(HTML.Tag.BODY))) {
              if(iTotalContentWidth == 0) {
                iTotalContentWidth = iTotalWidth;
                iTotalWidth = 0;
              else if(iTotalWidth > iTotalContentWidth) {
                iTotalContentWidth = iTotalWidth;
                iTotalWidth = 0;
              else {
                iTotalWidth = 0;
              if(tag.equals(HTML.Tag.H1) || tag.equals(HTML.Tag.H2) || tag.equals(HTML.Tag.H3) || tag.equals(HTML.Tag.H4)) {
                iHardBreakCount += 3; //These count as three lines (Blank - Content - Blank)
              else {
                iHardBreakCount++;
            iBreakCount++;
      if(!bBreakDetected) {
        Font font;
        FontMetrics fontMetrics;
        if(e.getDocument() instanceof HTMLDocument) {
          font = ((HTMLDocument)e.getDocument()).getStyleSheet().getFont(e.getAttributes());
          fontMetrics = getFontMetrics(font);
        else {
          font = getFont();
          fontMetrics = getFontMetrics(font);
        int iRangeStart = e.getStartOffset();
        int iRangeEnd = e.getEndOffset();
        if(fontMetrics.getHeight() > iMaxHeight) {
          iMaxHeight = fontMetrics.getHeight();
        if(e.isLeaf()) {
          String strText;
          try {
            strText = this.getText(iRangeStart, iRangeEnd - iRangeStart);
            if(strText.equals("\n")) {
              //iBreakCount++;
            iTotalWidth += SwingUtilities.computeStringWidth(fontMetrics, strText);
          catch (BadLocationException ex) {
            //Something happened.....don't care....just eat the exception
    m_iMaxFontHeight = iMaxHeight;
    m_iWidthOfContent = iTotalWidth;
    m_iHardBreakCount = iHardBreakCount;
    if(iWidth > 0) {
      int iLineCount = (iTotalWidth / iWidth) + iBreakCount;
      return iLineCount;
    return 1;
  }And here is the code from my TableCellRenderer that uses the above information
   public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                                                  boolean hasFocus, int row, int column) {
     if(ValidationHelper.hasText(value) && value.toString().indexOf("<html>") != -1) {
       UCSHTMLTextPane pane = new UCSHTMLTextPane();
       pane.setText(ValidationHelper.getTrimmedText(value.toString()));
       BigDecimal lWidthCell = new BigDecimal(table.getCellRect(row, column, false).getWidth() - 15);
       BigDecimal lWidthContent = new BigDecimal(pane.getWidthOfContent(lWidthCell.intValue()));
       int iHardBreakCount = pane.getHardBreakCount();
       BigDecimal lLineCount = lWidthContent.divide(lWidthCell, BigDecimal.ROUND_CEILING);
       int iLineCount = lLineCount.intValue();
       double dWidthCell = lWidthCell.doubleValue();
       double dWidthContent = lWidthContent.doubleValue();
       double dWidthContentPlusFivePercent = dWidthContent + (dWidthContent * .01);
       double dWidthContentMinumFivePercent = dWidthContent - (dWidthContent * .01);
       if(dWidthCell >= dWidthContentMinumFivePercent && dWidthCell <= dWidthContentPlusFivePercent) {
         iLineCount++;
       iLineCount += iHardBreakCount;
       int iMaxFontHeight = pane.getMaxFontHeight();
       int iHeight = (iMaxFontHeight * iLineCount) + 5;
       if ( (iLineCount > 0) && (table.getRowHeight(row) != iHeight)) {
         pane.setPreferredSize(new Dimension(0, iHeight));
         if(m_bAutoAdjustHeight) {
           table.setRowHeight(row, iHeight);
       if(iLineCount == 1) {
         if(iHeight != table.getRowHeight()) {
           if(m_bAutoAdjustHeight) {
             table.setRowHeight(iHeight);
       setComponentUI(pane, table, row, column, isSelected, hasFocus);
       return pane;
}Any suggestions?

Hello,
You must initialize correctly your JTextPane like this:
javax.swing.text.html.HTMLEditorKit htmlEditorKit = new javax.swing.text.html.HTMLEditorKit();
javax.swing.text.html.HTMLDocument htmlDoc = (javax.swing.text.html.HTMLDocument)htmlEditorKit.createDefaultDocument();
setEditorKit(htmlEditorKit);
setDocument(htmlDoc);
setEditable(true);
setContentType("text/html");

Similar Messages

  • Problem with JTextPane and StateInvariantError

    Hi. I am having a problem with JTextPanes and changing only certain text to bold. I am writing a chat program and would like to allow users to make certain text in their entries bold. The best way I can think of to do this is to add <b> and </b> tags to the beginning and end of any text that is to be bold. When the other client receives the message, the program will take out all of the <b> and </b> tags and display any text between them as bold (or italic with <i> and </i>). I've searched the forums a lot and figured out several ways to make the text bold, and several ways to determine which text is bold before sending the text, but none that work together. Currently, I add the bold tags with this code: (note: messageDoc is a StyledDocument and messageText is a JTextPane)
    public String getMessageText() {
              String text = null;
              boolean bold = false, italic = false;
              for (int i = 0; i < messageDoc.getLength(); i++) {
                   messageText.setCaretPosition(i);
                   if (StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && !bold) {
                        bold = true;
                        if (text != null) {
                             text = text + "<b>";
                        else {
                             text = "<b>";
                   else if (StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && bold) {
                        // Do nothing
                   else if (!StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && bold) {
                        bold = false;
                        if (text != null) {
                             text = text + "</b>";
                        else {
                             text = "</b>";
                   try {
                        if (text != null) {
                             text = text + messageDoc.getText(i,1);
                        else {
                             text = messageDoc.getText(i, 1);
                   catch (BadLocationException e) {
                        System.out.println("An error occurred while getting the text from the message document");
                        e.printStackTrace();
              return text;
         } // end getMessageText()When the message is sent to the other client, the program searches through the received message and changes the text between the bold tags to bold. This seems as if it should work, but as soon as I click on the bold button, I get a StateInvariantError. The code for my button is:
    public void actionPerformed(ActionEvent evt) {
              if (evt.getSource() == bold) {
                   MutableAttributeSet bold = new SimpleAttributeSet();
                   StyleConstants.setBold(bold, true);
                   messageText.getStyledDocument().setCharacterAttributes(messageText.getSelectionStart(), messageText.getSelectionStart() - messageText.getSelectionEnd() - 1, bold, false);
         } //end actionPerformed()Can anyone help me to figure out why this error is being thrown? I have searched for a while to figure out this way of doing what I'm trying to do and I've found out that a StateInvariantError has been reported as a bug in several different circumstances but not in relation to this. Or, if there is a better way to add and check the style of the text that would be great as well. Any help is much appreciated, thanks in advance.

    Swing related questions should be posted in the Swing forum.
    Can't tell from you code what the problem is because I don't know the context of how each method is invoked. But it would seem like you are trying to query the data in the Document while the Document is being updated. Try wrapping the getMessageText() method is a SwingUtilities.invokeLater().
    There is no need to write custom code for a Bold Action you can just use:
    JButton bold = new JButton( new StyledEditorKit.BoldAction() );Also your code to build the text String is not very efficient. You should not be using string concatenation to append text to the string. You should be using a StringBuffer or StringBuilder.

  • JTextPane and HTML rendering

    HAi
    I have a web page with JApplet in it.
    I need to get a HTML page from server and display it. I wish to use either JEditorPane or JTextPane.
    The applet gets the file line by line from the server. I need to append the line by line to the component.
    (i need to do some mappings before displaying, thats why i need to get text in parts.)
    I tried to append line by line to JTextPane. But Pane is treating as text file. The tags are not getting recognised. Instead whole of the file is being displayed along with tags.
    Is there any way by which i can append the file line by line with the tags being interpreted as they should be.
    Anticipating an early reply
    With thanks and regards
    Maruti

    Hello,
    You must initialize correctly your JTextPane like this:
    javax.swing.text.html.HTMLEditorKit htmlEditorKit = new javax.swing.text.html.HTMLEditorKit();
    javax.swing.text.html.HTMLDocument htmlDoc = (javax.swing.text.html.HTMLDocument)htmlEditorKit.createDefaultDocument();
    setEditorKit(htmlEditorKit);
    setDocument(htmlDoc);
    setEditable(true);
    setContentType("text/html");

  • IWeb 09 - Bug Report with album and html fragment

    I create an album with iPhoto and I insert it in a existent album page.
    Publish the site in a local directory.
    Navigate the page from the local directory and the page works.
    Publish the site using Cyberduck FTP and navigate the page from the www
    Results, the album doesn't work, only text in page.
    Here the link of the page that I create with iWeb08 (work)
    http://www.newsisters.it/ita/Album2009/Album2009.html
    and here link of the page that I create with iWeb09 (doesn't work)
    http://www.newsisters.it/ita/Album2009_error/Album2009.html
    in this page at the left bottom I insert an HTML code for Counter Statistic from Shinystat,
    it works using iWeb08 and doesn't work using iWeb09.
    The code is
    <!-- Inizio Codice Shinystat -->
    <script type="text/javascript" language="JavaScript" src="http://codice.shinystat.com/cgi-bin/getcod.cgi?USER=newsisters"></script>
    <noscript>
    </noscript>
    <!-- Fine Codice Shinystat -->
    Help me Please!
    Thanks a lot

    See: Some songs don't don't show under artist on my iPod.
    From what I understand, once you add a second album name for that artist even for a single song, ALL the rest of the songs should now show up under that artist, even those without album names.

  • Firefox 2.0 - Problems with Webdynpro and HTML iviews

    Hello all,
    We have implemented the SAP Netweaver portal 7.0 SP 10. Everything works fine on IE 6.0 and 7.0. When we tested it on Firefox 2.0, we encountered the following problems:
    1. The links on the detailed navigation area are missing
    2. Web Dynpro applications dont work very well. Eg: Clicking on "Next" button does not take you to the next view, OVS does not work etc.
    3. SAP transaction iViews(HTML) don't show up at all.
    Although the <a href="https://websmp108.sap-ag.de/~sapidb/011000358700001936242005E#391,7,SAP NetWeaver 7.0 (2004s) Browser Support                                 For End Users and Admin Functionality">PAM</a> indicates that Firefox 2.0 is supported for Webdynpro and HTML iviews, I am not sure why this is happening. Can someone help?
    Thanks and Regards,
    Reena

    Adobe are working on updating their add-on for Firefox 4 - http://kb2.adobe.com/cps/896/cpsid_89622.html
    McAfee have released a version of the Site Advisor for Firefox 4, but this add-on has caused problems for some people such as not being able to permanently hide the add-ons bar and issues with the back button not consistently working.

  • Word wrapping with JTextPane and styleDocument

    Hello,
    Can someone help me with the following problem.
    I have a JTextPane where i add a styledDocument.
    If i fill this with text it doen't word-warp the text!
    import javax.swing.JTextPane;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.Style;
    import javax.swing.text.StyledDocument;
    public class LogField extends JTextPane implements LogFileTailerListener{
         public static StyledDocument doc;
         private LogFileTailer tailer;
         private TextStyles styles;
         public LogField(){
              this.setEditable(false);
              this.setContentType("text/html");
              doc = (StyledDocument)this.getDocument();
              styles = new TextStyles();
              tailer = new LogFileTailer( LogPanel.logFileName, 1000, true );
              tailer.addLogFileTailerListener( this );
             tailer.start();          
         public void addText(String text, Style style){     
               try {
                  text = text + System.getProperty("line.separator");
                   doc.insertString(doc.getLength(), text, style);
              } catch (BadLocationException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              this.setCaretPosition(doc.getLength());
         @Override
         public void newLogFileLine(String line) {
                addText(line,styles.getDefaultStyle());
    }

    Since you are simply appending text to the Document you should not be using a type of "text/html".
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.

  • Problem with CSS and HTML

    I don't understand what is wrong but I don't see the styles when I preview my html in chrome.
    Here's my CSS
    @charset "UTF-8";
    /* CSS Document */
    html {
              min-width: 768px;
    body {
              font-size: 100%;
              font-family: Arial, Helvetica, sans-serif;
              line-height: 1.5rem;
    .wrapper {}
    img {
              width: 100%; /*All images will be 100% the size of their parent */
    .baseline {
              background-image: url(../images/baseline.svg);
    strong {
              font-weight: bold;
    em {
              font-style: italic;
    /* ----------------------------------------------------------------------------------------- ------------- Masthead */
    .masthead {
              height: 6rem;
              background-color: rgba(51,153,255,1);
              margin-bottom: 1,5rem;
    h1 {
              font-size: 1.5rem;
              color: #9F6;
              position: absolute;
              margin: 2.25rem 0 0 4%;
    /*---------------------------------------------------------------------------------------- --------------------article --*/
    article {
              padding: 0 4% 1.5rem;
    .headline {
              height: 4.5rem;
              margin-bottom: 1.5rem;
              background-colour: rgba(0,0,0,.15)
    h2 {
              font-family:Georgia,"Times New Roman", Times, serif;
              font-size: 2.25rem;
              position: absolute;
              margin: 1.5rem 2% 0;
    .placeholder {
              width: 20%;
              flow: left;
              margin: 0 2.5% 1.5rem 0;
    p {
              margin-bottom: 1.5rem;
    .footnote {
              height: 4.5rem;
              background-color: rgba(0,0,0,.15)
    .footnote p {
              font-size: .875rem;
              position: absolute;
              margin: 1.5rem 2% 0;
    /*---------------------------------------------------------------------------------------- -------------------- Bottom --*/
    .Bottom {
              height: 15rem;
              background-color: rgba(51,153,255,1);
    .bottom p {
              font-sizes: .875rem;
              color; #FFF;
              position:absolute;
              margin: 1.5rem 4%
    Here's my HTML
    <!doctype html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Box Model Tutorial</title>
    <link href="box-model/reset.css" rel="stylesheet">
    <link href="box-model/general.css" rel="stylesheet">
    </head>
    <body class="baseline">
    <!-------------------------------------------------------------------------- Masthead -->  
                      <header class="masthead baseline"> <!-- A group of introductory or navigational aids -->
                                    <h1>Victoria</h1>
    <!-------------------------------------------------------------------------- Masthead -->
               <div class="wrapper">
                             <article>
                              <header class="headline">
                                        <h2>Tourism British-Columbia</h2>
                              </header>
                                   <img src="box-model/images/images/British_Columbia_Legislative_Building,_Victoria,_BC_Wallpape r_2c8nm-1.jpg" alt="box-model/images/images/British_Columbia_Legislative_Building,_Victoria,_BC_Wallpape r_2c8nm-1.jpg">
                                    <!-- Don't Forget the alt -->
                                    <p>The capital city of British Columbia, Victoria boasts many historic buildings and some of the most fascinating museums in Western Canada. The city benefits from one of Canada's mildest climates, which allows its residents to pursue outdoor pleasures all year round.
    Victoria enjoys some of the country's most exhilarating scenery: there's an ocean or mountain vista around every corner, while the city's flower gardens are famous the world over. Whether your taste runs to golfing, hiking, biking and fishing or you're more the shopping, dining and theatre type, there are no end of delights for you and your family in Victoria – the city was included in the Top 10 Family Vacations in Canada in the TripAdvisor 2011 Travelers' Choice awards.
    Established in 1843 by James Douglas as a fort for the Hudson's Bay Company, Victoria's British ancestry is apparent in the double-decker buses, horse-drawn carriages, formal gardens, and tearooms. The city is now a cosmopolitan centre with a lively entertainment scene and a wonderful array of attractions.</p>
                   <footer class="footnote">
                                         <p> Article Footer (Related Articles, Footnotes, Authors Bio, etc.) </p>
                                     </footer>
                          </article>
                           </div> <!-- Wrapper Close -->
    <!---------------------------------------------------------------------------------------- -------------Bottom -->
        <footer class="bottom">
                 <p>Main Footer (Copyright, related Links, Legal, privacy, logo, etc.)</p>
        </footer>
    </body>
    </html>

    Lines 6 & 7 of your HTML file (exercise-boxmodel.html), change this:
    <link href="box-model/reset.css" rel="stylesheet">
    <link href="box-model/general.css" rel="stylesheet">
    to this:
    <link href="reset.css" rel="stylesheet">
    <link href="general.css" rel="stylesheet">
    Your CSS files are in the same folder as your .html file. But your original linkage shows that they're within a sub-folder called 'box-model'. That link was returning a 404 Not found error. Hence, the browser was unable to load your CSS files.
    Replace the code and you should be able to view it.

  • Airplane help with Webhelp and HTML Help

    Hi. We are generating 2 outputs using Robohelp v.6.0: HTML
    Help and WebHelp. Standalone they both work fine. The context
    sensitive .chm works too. Problems are:
    1.) the primary help (Webhelp) does not appear - there isn't
    any error msg either.
    2.) when an invalid url is used the secondary help file does
    appear (HTML help). But this doesn't happen with the correct url of
    the primary help - Webhelp
    Isn't there supposed to be a reference to the mapping in the
    <head> of each htm file?
    Can anyone help on this topic? many thanks!

    First, move the styles from the form generator to the <head> of your document.  Otherwise there is a possibility browsers could ignore the invalid code.
    Then move your form div inside the banner div and set the attribute float:right; in your CSS for the form div.  Then you should be good to go.

  • Editing a XML file with PHP and HTML or AS2

    Hi webmates...
    I have been looking for a good tutorial on managing an XML
    file through Flash (AS2) or HTML and PHP... but all of what I have
    found at the moment are very confusing and incomplete... the
    examples actually do not work ok...
    Would anyone mind on addressing me any good place where I can
    find nice tutorials for this ? perhaps any example ? I wil really
    appreciate it, My web is already reading the XML file to load
    data... but I also need to create an application for editing this
    XML... thanx in advance...

    I have no experience with any decompilers beyond possibly attempting to trial one once.  The only one I have seen recommended is made by Sothink.
    Here is a link to a page with a tool that has an interface you can use to determine various properties of an swf file, including the Actionscript version.
    http://blog.sitedaniel.com/2009/11/swf-info-width-height-swf-version-actionscript-version- framerate/

  • JSF with TILES and HTML-Code

    Hello!
    I have a pure JSP-project using tiles. Now I want to migrate to JSF and find some problems.
    When I use my existing layout and include the different JSPs I have no problem as long I have a single f:view in every jsp file is used. When I try to define f:view and a h:form including different files and in each file JSF componets where used I got a very bad result. Additiotal I have to say, that I try to keep my formatting with HTML tags existing.
    The effect is, that all JSF componets were rendered at the beginning of the jsp file and than be included into the layout.
    Have I use a special order of f:view, f:subview, h:form, ....
    Alternative I could make a complete reprogramming of the JSP's, not my favourit, but than I need the possibility to set single formats for each <td> in a table and this seems not to be possible with h:panelGrid.
    Havy anyone an idea?
    Thanks for your help!

    Read about facelets as a replacement for tiles in jsf.

  • Fighting with JApplet and HTML

    Ifmy Browser is using jvm1.4.1 do I still have to use the html converter to display my JApplet?
    This is the error I get from the java console:
    java.lang.InstantiationException: QuestionScreen
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Thanks
    Jim

    The reason that I ask is because if the MS JVM is used, which is version 1.1, and an applet that has been compiled with a recent version of Sun JVM like 1.4.2 attempts to run in the MS JVM, then a ClassNotFoundException will be generated regardless of the position of the class files. So it is very important to determine that your browser is really using the Sun JVM..Try to view the console with the applet running to be sure.
    Note that the applet tag has been deprecated. But if you use the applet tag, I suggest including a codebase attribute such as "." which refers to the current working directory, where the index.html file originated.
    <applet code="com.myjavaserver.codecraig.applet.JMoviesApplet.class" codebase="." archive="JMovies.jar, jdom.jar, packer.jar" width="800" height="600">
    Your browser is completely ignoring the <APPLET> tag.
    </applet>You may want to try the object tag, and see if you can avoid the error. The class id value is for dynamic versioning..
    <object classid="8AD9C840-044E-11D1-B3E9-00805F499D93" width="800" height="600">
    <param name="type" value="application/x-java-applet;version=1.4">
    <param name="code" value="com.myjavaserver.codecraig.applet.JMoviesApplet.class">
    <param name="codebase" value=".">
    <param name="archive" value="JMovies.jar, jdom.jar, packer.jar">
    Your browser is completely ignoring the <object> tag.
    </object>

  • JTextPane and HTML

    My pane is continuing to display the text as plain text instead of html. Why is that?
    JTextPane p=new JTextPane(new HTMLDocument());
    add(p);
    String html="<html><body>TEST</body></html>
    p.setText(html);From what I've learned from the documentation, the pane is initialised with html. When using setText(), the pane still keeps it html style. So, why am I getting plain text???

    If I explicitly use setContentType("text/html") it works.
    But it only works for small html pages. If I use a setText for a page greater than 50k, the page is blank. After that, a getText() results in this:
    <html>
    <head>
    </head>
    <body>
    </body>
    </html>
    Is there a maximum?

  • Help With Flash and HTML

    I have just completed my website(www.Aquiteoddsite.com).
    It is a variety cartoon site for my partner and I. We where
    going to upload the file the other day but when we put it on an
    HTML page- The Audio was happing abut a second before the
    animation. I then checked to make sure it was not in the actual
    file. I wacthed it by itself and it worked fine. Then I tried again
    to toput it on an html page- once again it wigged out. Finnaly I
    tried to put it on a different site and it still failed o work
    properly. I don't remeber futzing around with my publishing
    settings either.
    If you be so kind as to help me, we would greatly apprecate
    it. to the 5th power.
    Thanks in advance. Quite Odd.

    All Active content on a page will always rise to the top, so
    to speak,
    including Flash, certain form elements, Java applets, and
    Active X controls.
    This means that each of these will poke through layers. There
    is not a good
    cross-browser/platform reliable way to solve this issue, but
    if you can be
    confident in your visitors using IE 5+ or NN6+, then you can
    use the Flash
    wmode parameter (however, Safari does not support this
    properly!).
    Adobe articles:
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_15523
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_14201
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "[email protected]" <[email protected]>
    wrote in message
    news:foc4db$2nh$[email protected]..
    > Hi folks, just a quick query that i'm sure someone out
    there will know
    > the
    > answer to (or at least i'm hoping someone will) I've
    been working on a
    > new
    > site (first attempt so be gentle with any criticism
    please!!) I used
    > fireworks8 to create a navmenu and it works a treat,
    however i also have
    > flash
    > on some of the pages, and the fireworks submenus don't
    seem to like
    > showing up
    > over the flash! see
    http://www.gammies.co.uk/construction.asp
    for what i
    > mean.
    > the nav links to construction, groundcare and
    recreational don't show
    > becuase
    > of the flash. I was trying to see if there was some
    option to send the
    > flash
    > to the back of the page as such so that the navmenu was
    on top but
    > couldn't get
    > it, and i'm no sure what i'd have to do code wise to
    change it (if it's a
    > code
    > issue). By the way it does it in both firefox and IE All
    help greatly
    > appreciated.. Thanks Chris
    >

  • JTextPane and HTML form

    I'd like to display html page containing simple HTML form. JTectPane renders tis form very good but i sthere any way to handle any data change/submit on such a form in JTextPane

    Hi,
    Take a look at this example
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    public class TestShowPage {
    public static void main(String args[]) { 
    JTextPane tp = new JTextPane();
    JScrollPane js = new JScrollPane();
    js.getViewport().add(tp);
    JFrame jf = new JFrame();
    jf.getContentPane().add(js);
    jf.pack();
    jf.setSize(400,500);
    jf.setVisible(true);
    try {
    URL url = new URL("http://www.globalleafs.com/Download.html" );
    tp.setPage(url);
    catch (Exception e) {
    e.printStackTrace();
    Just compile and run the programme. see the output. If you need more info of such type of programmes, check http://www.globalleafs.com/Download.html
    Uma
    Java Developer
    http://www.globalleafs.com

  • Problem with jspf and html table

    hi
    i want to create a single table in a jsp fragment file. the table should have
    letter A_Z which should be command link components. my problem
    is the html part of it. here is my code
    <table width="600" border="0">
        <TR>
            <%for(char i='A';i<='Z';i++)%>
              <TD><%i%></TD>
        </TR>
    </table>my netbeans highlights the line <TD><%i%></TD> and says = not a statement ';' expected. adding ; doesnt solve it. any idea or approach

    SomeBody_Else wrote:
    Change this line
    <TD><%i%></TD>to this
    <TD><%= i%></TD>
    That won't compile. You would need:
    <%for(char i='A';i<='Z';i++) {%>
      <TD><%=i%></TD>
    <%}%>

Maybe you are looking for