JEditorPane doesn't redraw if URL same

I'm generating HTML by styling an XML file using XSLT to a temp HTML file and using jEditorPane.setPage( tempURL ) to display it. No problem there. However if I regenerate new content to the same file name and ask JEditorPane to draw this then it says to itself "this is the same URL I put up before so I'm not going to redraw it" - even though the actual contents of the file have changed.
I don't want to have to use a different temp file for each run, or even to flop back and forth between 2 temp files (which I believe would work).
How do I get JEditorPane to redraw if the file name is the same as the previous call?

Here's my solution - I replace the HTMLEditorKit if it's not the first pass through. I found that the EditorKit is an instance of HTMLEditorKit for every pass except the first (which doesn't have a problem).
EditorKit ek = displayJEditorPane.getEditorKit();
if( ek instanceof HTMLEditorKit ) {
     // Needs to be replaced
     HTMLEditorKit htmlEditorKit = new HTMLEditorKit();
     displayJEditorPane.setEditorKit( htmlEditorKit );
// Display the HTML document
displayJEditorPane.setPage( resultURL );I'll spread my Duke Dollars around to everyone who offered a suggestion later today if I don't hear of a better solution.
Thanks.

Similar Messages

  • Jeditorpane doesn't convert "Enter"-buttonklick to br

    Hi all,
    i have jedtiorpane(text/html) where i can type in text.
    if i push the Enter-Button jeditorpane doesn't convert this button-click to <br>.
    How can i solve it? Is there any sample-code?
    its had me tearing my hair out all day..
    If somebody could please help me what i do wrong here, i would highly
    appreciate it.
    thx a lot!
    Fibo

    I also face the same issue. Any solutions
    Test case 1:
    Enter 101110 and it formats to 10/11/2010
    Now delete(erase) 10/11/2010 and enter 101110 and tab out, now the formatting doesn't work.
    Also I have another question. how to control the year to start with 19 rather than 20
    for example if the user enters 101138, then i want it to be 10/11/1938 rather than 20/11/2038
    Edited by: user10438627 on Feb 10, 2011 9:36 AM

  • Live view doesn't correctly pass URL parameters from HTML docs?

    Running into something that I wonder if anyone else has seen.  I've created a site in DW CS5 with a local testing server (XAMPP on Win7), and if I use LiveView to view an HTML page that has a link to a PHP page that includes a URL parameter, the parameter shows up in the LiveView address bar, but the page doesn't seem to use it (trying to display an image where the file is built using $_GET to retrieve the parameter).  The same HTML page, displayed in a browser, works.  And if I then save the HTML page as a PHP page in DW, identical code, LiveView works.  Sure looks like LiveView will does not properly handle URL parameters from HTML documents...

    Sorry if I wasn't clear... the navigation works correctly; I get to the page I'm tyring to get to.  One of the things that page should do is display an image, the I use a URL parameter to build the image file name to retrieve.  The link in the first page is something like <a href="gallery.php?pg=1">.  Works fine if the first page (the one I'm navigating from) is a PHP page, doesn't work (with the same code which is only HTML) if the page is an HTML page.

  • Can negative B&W image be converted to positive, done this on elements previously by inverting but doesn't seem to work same way in lightroom ?

    Can negative B&W image be converted to positive, done this on elements previously by inverting but doesn't seem to work same way in lightroom ?

    You should be able to invert in Lightroom. But choose the point curve rather than the region curve. If the negative is film you might get better results from scanning.

  • JEditorPane doesn't processes forms

    Hello there!
    I'm developing an app where I use a JEditorPane to view HTML documents, everything is fine, but JEditorPane doesn't process forms on a document. I need something to trigger some functions when the user clicks on the "send" button of the form.
    Any Ideas????
    Thanks in advance!

    just put an actionlistener on the button an call the functions as usual.

  • JTable edited data doesn't appear in the same time

    Hi
    i have aserious problem JTable edited data doesn't appear in the same time imust tom minimize the frame and maximize it to see the table modified what is the reason?

    Quit multi-posting the same question every time. You asked this same question 3 hours ago:
    http://forum.java.sun.com/thread.jspa?threadID=729894
    The last time you posted the same question within two minutes of one another:
    http://forum.java.sun.com/thread.jspa?threadID=729202
    http://forum.java.sun.com/thread.jspa?threadID=729200
    Not only that, you never bother to reply to your postings to indicate whether the advice given was helpfully or not. This is commonly known as thanking people for the time spent helping your.
    Learn to use the forum correctly or you will be on your own in the future.

  • UTF-8 Unicode in JEditorPane doesn't work

    I do hope this is the correct forum for this question so that some forum nazi doesn't give me grief...here goes.
    I have a JEditorPane with the contentType set to "text/html; charset=UTF-8"
    I do a .setText method with this text:
    <HTML><body><font face='Arial Unicode MS' size='3'>
    Followed by some text extracted from an RSS feed (just the contents of the <description> tag)
    and then </body></html> to finish it off.
    It displays fine apart from a unicode character, it looks like one of those 'fancy' apostrophes so that in the word "We've" the appostrophe shows as an accented a and two squares as shown in this screenshot : Screenshot
    So does that mean that 'Arial Unicode MS' cannot display Unicode as the name would suggest, or am I doing something else wrong?

    When you specify the charset in the contentType setting, you're telling the JEditorPane how to convert raw bytes that it reads from a URL into a Java string. That's assuming you use one of the setPage() methods to populate the component--but you're using setText(), which takes a String. That means the text was corrupted before you put it in the JEditorPane; you need to look at how it's getting brought in from the RSS feed. It's obviously encoded as UTF-8, but being decoded as if it were a single-byte encoding like ISO-8859-1 or windows-1252 (the default for English-locale Windows systems).

  • Spry Accordion only works once and doesn't redraw after content update

    Hello,
    I am constructing an Accordion via inner.HTML.  I finally got this to work, HOWEVER, it will only execute correctly once.  When I call "doSpryData" the first time all is well.  When it gets called the second time, the "alerts" fire but the Accordion does not redraw itself and no data is displayed (function doSpryData below).
    I would appreciate any ideas on what I'm doing wrong!!!!
    Thanks and cheers!
    function doSpryData(){
              alert("in spry data!");
              var thisWhat = document.getElementById("searchByWhat").value;
        var currentid = document.getElementById("thisid").value;
              var myStr = "";
              var Acc1 = "";
              Mailings.url = "GetXML1.asp?what="+thisWhat+"&thisid="+currentid;
              Mailings.loadData();
              Mailings1.url = "GetXML2.asp?what="+thisWhat+"&thisid="+currentid;
              Mailings1.loadData();
              if ((thisWhat =="1") || (thisWhat =="2")){
              myStr += "<div id='example1Region' spry:region='Mailings1' >";
                        myStr += "<div id='Acc1' class='Accordion' tabindex='0'>";
                                  myStr += "<div id='Panel1'  class='AccordionPanel'>";
                                            myStr += "<div class='AccordionPanelTab'>{CompanyName} - Info</div>";
                                            myStr += "<div class='AccordionPanelContent'>{CO_Address1}<br>{CO_Address2}<br>{CO_City} <br>{CO_Country}</div></div>";
                        myStr += "<div  class='AccordionPanel'>";
                                  myStr += "<div class='AccordionPanelTab'>{CompanyName} - Trainees</div>";
                                  myStr += "<div class='AccordionPanelContent'>";
                                  myStr += "<table width='969' id='MyResults1' border='0' cellspacing='2' cellpadding='2' >";
                 myStr += "<tr id='thead' height='25' bgcolor='#FFFFFF' '>";
                 myStr += "<th width='20'   class='contactinfo'>Edit</th>";
                myStr += "<th width='20' class='contactinfo' align='center'>Select</th>";
                 myStr += "<th width='170' class='contactinfo' spry:sort='TraineeLastName'>Trainee</th>";
              myStr += "<th width='160' class='contactinfo' align='center'>Title</th>";
                 myStr += "<th width='160' class='contactinfo'>Phone</th>";
                 myStr += "<th width='250' class='contactinfo'>Email </th>";
                 myStr += "<th width='95' class='contactinfo'>Internal Code </th>"; 
                 myStr += "<th width='30' class='contactinfo'>Active</th></tr>";
              myStr += "<tr><td style='padding-bottom:20px;'></td></tr>";
              myStr += "<table class='scrollTable' border='1' cellspacing='2' cellpadding='2' >"
               myStr += "<tr  spry:repeat='Mailings1' spry:setrow='Mailings1' spry:hover='hover' spry:even='even' spry:odd='odd'>";
                myStr += "<td  width='23' align='center'><input name='SelectedProspect' id='SelectedProspect' type='radio' onclick = 'OpeniFrameURL('EditCandidateForm.asp?pid='+{CKeyNew}, 600,800); return false;'></td>";
                myStr += "<td  width='23' class='detail' align='center'><input type='checkbox' name='SelectedOne' id='SelectedOne' value='{CKeyNew}'/></td>";
                myStr += "<td  width='180'class='detail'>{TraineeLastName},  {TraineeFirstName}</td>";
                 myStr += "<td  width='165'class='detail'>{JobTitle}</td>";
                 myStr += "<td  width='160'align='center'  class='detail'>{TR_CellPhone} / {TraineePhoneNumber}</td>";
                myStr += "<td  width='250'class='detail'>{TraineeEmail}</td>";
                myStr += "<td  width='105' class='detail'>{InternalCode}</td>";
                myStr += "<td  width='30' class='detail'>{TraineeActive}</td>";
                myStr += "</tr>";
                myStr += "</table></table>";
                                  myStr += "</div></div>";
              myStr += "</div></div><scr"+"ipt type='text/javascript'>var Acc1 = new Spry.Widget.Accordion('Acc1');Spry.Data.initRegions('example1Region');</"+"script>";
              alert(myStr);
              var div = document.getElementById("mainContent"); 
       div.innerHTML = myStr;
       var x = div.getElementsByTagName("script");
       for(var i=0;i<x.length;i++) 
           eval(x[i].text);
    var observer = { onPostUpdate: function(notifier, data) { alert("post update!");var Acc1 = new Spry.Widget.Accordion('Acc1'); } };
    Spry.Data.Region.addObserver("example1Region", observer);
    /*Spry.Data.initRegions("example1Region");
    Spry.Data.updateAllRegions();*/

    Hello to all,
    I have spent HOURS trying to figure this out....
    I know the above code is messy, but it does correctly do the accordions via innerHTML.  I have a dropdown on my page and when the user changes the input there, I call "doSpryData" and it is supposed to 1) reload XMLDataSet and 2) redraw the Accordion (I would like to have different data displayed on the same page depending on what user selects).  For some reason, it will not redraw the accordion and show the data after it has been done once. 
    I am really desperate so any ideas would be much appreciated!
    Cheers,

  • [NEVER ACTUALLY BROKEN] seamonkey doesn't display current url

    I've scroogled this over and over, maybe I just don't know what to call this problem.
    I have a bunch of tabs open in seamonkey. If I switch tabs, or click the back button, the url in the location bar doesn't change.
    If I've typed in a url it goes to that address, but then if I switch tabs, go back, open a new tab to my homepage, select a bookmark, the url never changes.
    If the background to the url has changed to golden because I entered a https url, then I can go back or switch to another tab that is not secure and the bar stays golden.
    If I clear all of the text from the url bar, I can switch tabs, load pages via bookmark, whatever, the url bar stays blank.
    It seems the only time the url is correct is right after I enter one. Any change in the url via back, forward, changing tab, new tab is not reflected in the location bar.
    This makes it impossible to see what the url of the current page is, which I often do in order to mark and splat into email or docs.
    I found a couple of bugzilla tickets from 2002 and 2004, but nothing recent at all.
    Has anyone else noticed this?
    I'm _really_ hoping this isn't another handy "feature" from google subsidiary, I mean mozilla foundation.
    I've tried switching to epiphany, but GTK apps lately seem determined not to work with mark=copy and middle click=paste, but that's a different gripe.
    Someone please tell me I'm just failing to find some config option that makes it actually work. Like maybe a check box that says: "Disable Location bar brokeness"?
    Thanks for any suggestions or commiseration...
    android
    Last edited by android (2011-08-16 14:51:18)

    You're right, this is tied to the profile.
    If I start with -ProfileManager it works correctly.
    Ohh, In fact now I've killed and restarted seamonkey and the location bar is working correctly 8-(
    Sorry, I guess it had just worked it's panties into a bunch somehow.
    I was sure I had restarted.
    Thanks for your support!
    P.S. i started to mark as SOLVED, but that didn't seem an appropriate adjective.
    Last edited by android (2011-08-16 14:52:28)

  • TS2570 doesn't work, still the same problem when using Rapidweaver software. NOT with other software.

    i tried everything in this article, but still have the same problem when using Rapidweaver software. NOT with other software. I am converting my iWeb site  to Rapidweaver, whenever there is a calmer period in my office. I have 16 Gb RAM on my NEW iMac and have Parallels desktop, mail, safari, iWeb and Rapidweaver running simultanious.
    I never have the problem if i don't use Rapidweaver, but after i have added several pages to Rapidweaver, the problem begins. my iMac won't start up. the only thing that works is re-installing Macos OS X 10.8. i tried even whiping the completeharddrive, and reinstalling with a complete new user, the same problem.
    I had it on my previous iMac also, and bought a new one because i thought the problem was in the iMac first. i hadn't noticed it only happens with using rapidweaver.
    i sent my complete rapidweaver project to the programmers from rapidweaver at Realmacsoftware, but they couldnt reproduce my problem, there macs started up without any problem.
    i deleted all the rapidweaver addons and extra stacks, and started a complete new project.
    saterday i had the problem again, after adding about 5 new pages to my rapidweaver site.
    i think i have reinstalled Macos OS X 10.8.2 20 or 30 times by now
    does anyone have a sollution?

    Type '''about:support''' in the URL bar and hit Enter.
    Scroll down almost to the bottom of that listing and see if you have '''user.js Preferences''' just above the '''''Graphics''''' category.
    If you do have that, click on '''user.js file''' in this sentence. <br />
    ''Your profile folder contains a user.js file, which includes preferences that were not created by Firefox.''
    Does that "different homepage" appear in that user.js file?

  • JEditorPane doesn�t display HTML special char. codes

    My application is using JEditorPane to display text/html.
    The problem comes when I try to display HTML special character codes such as
    &gt; JEditorPane ignores those codes and displays nothing.
    Do I have to convert all those strings representing special characters?
    How could I solve it?
    Thanks in advance,
    Bruno

    Here's my solution - I replace the HTMLEditorKit if it's not the first pass through. I found that the EditorKit is an instance of HTMLEditorKit for every pass except the first (which doesn't have a problem).
    EditorKit ek = displayJEditorPane.getEditorKit();
    if( ek instanceof HTMLEditorKit ) {
         // Needs to be replaced
         HTMLEditorKit htmlEditorKit = new HTMLEditorKit();
         displayJEditorPane.setEditorKit( htmlEditorKit );
    // Display the HTML document
    displayJEditorPane.setPage( resultURL );I'll spread my Duke Dollars around to everyone who offered a suggestion later today if I don't hear of a better solution.
    Thanks.

  • JEditorPane, setText, and redraw problems.

    This code was borrowed from another post on the forum. The aim is to append lines of text onto the bottom of the editor pane.
        JEditorPane messagePane = new JEditorPane("text/html", "");
        String text = messagePane.getText();
        text = text.substring(text.indexOf("<body>") + 6, text.indexOf("</body>"));
        text = text + "<br>" + message;
        messagePane.setText(text);It works, but the whole editor pane flashes when setText is called.
    Is there anything I can do to prevent this? I've tried setDoubleBuffered(true) but that doesn't seem to work.
    There are a whole lot of methods on HTMLDocument like insertBeforeEnd which should allow me to insert content before the end body tag, but they don't work anyway.

    I've encoutered this problem and I use the following to replace the call to setText, actually this call causes the flicker effect you experience (for some obscure reason involving callbacks and property change)
            String myString = "<html><body>Sample text, put yours here</body></html>";
            EditorKit kit = this.messagePane.getEditorKit();
            Document newDocument = kit.createDefaultDocument();
            StringReader reader = new StringReader(myString);
            try
                kit.read(reader, newDocument, 0);
                this.messagePane.setDocument(newDocument);
            catch (Exception e)
                this.messagePane.setText("Error " + e);
            }Et voil�, no more flickering !

  • Copy URL same session exist

    When I copy the URL in a new browser the same session exist.I want that when I copy the URL the session must be destroyed and a new session will be created.
    Kindly help me out.Thanks in advance

    A new session will only be created if you create a completely new instance of your browser.
    To achieve your requirement you might consider to write a filter which checks the referrer and if this is null or empty, then destroy the session. But this will also affect users who have disabled sending of the referrer along the headers to the server.

  • Adobe's Express Install doesn't load original url

    I implemented Adobe's Express Install on my website, and all
    works well except at the end of the process, it doesn't
    automatically close the original window with the old flash player
    and it doesn't automatically reload the original url typed into the
    new window with the new flash player. Adobe's documentation says
    that it is designed to do this, but these final two steps don't
    seem to be what happens.
    Does anyone know what code must be changed to make this
    happen?
    thanks for any help.

    you can contact adobe support and see if they can sell you another set of cds, Contact Customer Care
    but you should be able to download. you may need to use a different browser or different (wired) connection.
    Downloads available:
    Suite:  CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  12 | 11, 10 | 9,8,7
    Lightroom:  5 | 4 | 3
    Captivate:  7 | 6 | 5
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • Why the jsp tag jsp:forward page="page.jsp" / works when i work with web server iPlanet in a Solaris machine and doesn't work with the same web server, in a Windows 2000 machine ?

    The request parameters don't go to the "page.jsp"...

    If someone else runs into this, here is how I solved the problem -
              If you create a PrintWriter object with the autoflush option, it
              doesn't flush the underlying buffer till you call println on it. I
              looked through the generated code for the servlet, and it was doing a
              JSPWriter.print() to output information.
              So, I changed the ResponseWrapper to keep a handle to the PrintWriter
              object, and then flush it in the filter, and that works.
              Why the same code behaves differently in JRun & Weblogic, I'm not sure
              --Sridhar
              

Maybe you are looking for