JEditorPane.setPage(URL url), then I want to clean up HTML, how?

According to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4695909
the problem with the inconsistent ArrayIndexOutOfBoundsException that
I have been getting whenever I would go to a particular URL to put
into JEditorPane using setPage() - this may also be due to JEditorPane
containing HTML which contains a <META> tag and/or <!-- comment tag --
. I created a class SimpleHTMLRenderableEditorPane which extendsJEditorPane, based upon code I found in the aformentioned bug link
which should auto-strip out "bad tags":
* SimpleHTMLRenderableEditorPane.java
* Created on March 13, 2007, 3:39 PM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package com.ppowell.tools.ObjectTools.SwingTools;
import javax.swing.JEditorPane;
* A safer version of {@link javax.swing.JEditorPane}
* @author Phil Powell
* @version JDK 1.6.0
public class SimpleHTMLRenderableEditorPane extends JEditorPane {
    //--------------------------- --* CONSTRUCTORS *--
    // <editor-fold defaultstate="collapsed" desc=" Constructors
">
    /** Creates a new instance of SimpleHTMLRenderableEditorPane */
    public SimpleHTMLRenderableEditorPane() {
        super();
    // </editor-fold>
    //----------------------- --* GETTER/SETTER METHODS *--
    // <editor-fold defaultstate="collapsed" desc=" Getter/Setter
Methods ">
     * Overloaded to fix HTML rendering bug Bug ID: 4695909.
     * @param text
    public void setText(String text) {
        // Workaround for bug Bug ID: 4695909 in java 1.4
        // JEditorPane does not handle the META tag in the html HEAD
        if (isJava14() && "text/
html".equalsIgnoreCase(getContentType())) {
            text = stripMetaTag(text);
        super.setText(text);
    // </editor-fold>
    //--------------------------- --* OTHER METHODS *--
    // <editor-fold defaultstate="collapsed" desc=" Methods ">
     * Clean HTML to remove things like <script>, <style>, <object>,
<embed>, and <!-- -->
     * Based upon <a href="http://bugs.sun.com/bugdatabase/view_bug.do?
bug_id=4695909">bug report</a>
    public void cleanHTML() {
        try {
            String html = getText();
            if (html != null && !html.equals("")) {
                String[] patternArray = {
                    "<script[^>]*>[^<]*(</script>)?",
                    "<style[^>]*>[^<]*(</style>)?>",
                    "<object[^>]*>[^<]*(</object>)?>",
                    "<embed[^>]*>[^<]*(</embed>)?>",
                    "<!\\-\\-.*\\-\\->"
                for (int i = 0; i < patternArray.length; i++) {
                    html = html.replaceAll(patternArray, "");
setText(html);
} catch (Exception e) {} // DO NOTHING
* Determine if java version is 1.4.
* @return true if java version is 1.4.x....
private boolean isJava14() {
String version = System.getProperty("java.version");
return version.startsWith("1.4");
* Workaround for Bug ID: 4695909 in java 1.4, fixed in 1.5
* JEditorPane fails to display HTML BODY when META
* tag included in HEAD section.
* <html>
* <head>
* <META http-equiv="Content-Type" content="text/html;
charset=UTF-8">
* </head>
* <body>
* @param text html to strip.
* @return same HTML text w/o the META tag.
private String stripMetaTag(String text) {
// String used for searching, comparison and indexing
String textUpperCase = text.toUpperCase();
int indexHead = textUpperCase.indexOf("<META ");
int indexMeta = textUpperCase.indexOf("<META ");
int indexBody = textUpperCase.indexOf("<BODY ");
// Not found or meta not inside the head nothing to strip...
if (indexMeta == -1 || indexMeta > indexHead && indexMeta <
indexBody) {
return text;
// Find end of meta tag text.
int indexHeadEnd = textUpperCase.indexOf(">", indexMeta);
// Strip meta tag text
return text.substring(0, indexMeta-1) +
text.substring(indexHeadEnd+1);
// </editor-fold>
However, upon running the following line:
SimpleBrowser.this.browser.cleanHTML();I spawn the following exception:
Exception in thread "Thread-2" java.lang.RuntimeException: Must insert
new content into body element-
        at javax.swing.text.html.HTMLDocument
$HTMLReader.generateEndsSpecsForMidInsert(HTMLDocument.java:1961)
        at javax.swing.text.html.HTMLDocument
$HTMLReader.<init>(HTMLDocument.java:1908)
        at javax.swing.text.html.HTMLDocument
$HTMLReader.<init>(HTMLDocument.java:1782)
        at javax.swing.text.html.HTMLDocument
$HTMLReader.<init>(HTMLDocument.java:1777)
        at
javax.swing.text.html.HTMLDocument.getReader(HTMLDocument.java:137)
        at javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:
228)
        at javax.swing.JEditorPane.read(JEditorPane.java:556)
        at javax.swing.JEditorPane$PageLoader.run(JEditorPane.java:
647)What should I do at this point?
Thanks
Phil

Transfer all purchases from the iPad to iTunes on your computer, backup the iPad and then sync one last time.
Then go to Settings>General>Reset>Erase all content and Settings to completely erase the iPad.
Connect the new iPad to your computer and launch iTunes, restore from the backup of the old iPad and then sync with iTunes. You should be prompted to restore from the backup when you connect the new iPad to your computer's iTunes, but you can select it on your own as well.
Transfer purchases.
http://support.apple.com/kb/HT1848
How to backup
http://support.apple.com/kb/HT1766

Similar Messages

  • I want to clean up and clear my iPad so I can sell it to my brother

    Any recommendations how to upgrade to an iPad 3 with what is on the iPad 2>  Then, i want to clean the iPad to sell it.
    Thanks.

    Transfer all purchases from the iPad to iTunes on your computer, backup the iPad and then sync one last time.
    Then go to Settings>General>Reset>Erase all content and Settings to completely erase the iPad.
    Connect the new iPad to your computer and launch iTunes, restore from the backup of the old iPad and then sync with iTunes. You should be prompted to restore from the backup when you connect the new iPad to your computer's iTunes, but you can select it on your own as well.
    Transfer purchases.
    http://support.apple.com/kb/HT1848
    How to backup
    http://support.apple.com/kb/HT1766

  • Problem using the setPage(String url) of JEditorPane

    Hi all !
    I'm developping a text file generator which generates a text file and use a viewer to display the content of this text file.
    The first time, it works correctly, it displays the text file content but the others times it doesn't work correctly, the first text file content remains displayed.
    It seems that the setpage(String url) method doesn't work correctly.
    Does anyone know this problem ?
    In advance, thanks a lot.
    Best regards,
    Farid.
    Here is the code of the viewer:
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.lang.*;
    public class ViewerQCM extends JPanel {
         private JPanel panelSouth;
         private JLabel titreLabel;
         private JButton genererQCMButton;
         private JEditorPane editorPane;
         private JScrollPane scrollPane;
         public ViewerQCM() {
              JFrame frame = new JFrame("G�n�rateur de QCM");
              setLayout(new BorderLayout());
              panelSouth = new JPanel();
              panelSouth.setLayout(new FlowLayout());
    titreLabel = new JLabel("G�n�rateur de QCM", SwingConstants.CENTER);
              editorPane = new JEditorPane();
              editorPane.setContentType("text/plain");
    editorPane.setText("Cliquer sur le bouton \" G�n�rer QCM \" ");
              editorPane.setEditable(false);
              genererQCMButton = new JButton("G�n�rer QCM");
              genererQCMButton.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
              GenerateurDeQCM.getInstance().init();
              GenerateurDeQCM.getInstance().generateQuestionnaire();
                        try {
    editorPane.setPage("file:" + AccesBase.getString("generateur.QCM"));
                        catch (IOException ex) {
                             ex.printStackTrace();
    LogFile.getInstance().write("Exception *** IOException caught in constructor ViewerQCM() ***");
                   LogFile.getInstance().write(ex.getMessage());
                   LogFile.getInstance().flush();
              scrollPane = new JScrollPane(editorPane);
              add(titreLabel, BorderLayout.NORTH);
              add(scrollPane, BorderLayout.CENTER);
              panelSouth.add(genererQCMButton);
              add(panelSouth, BorderLayout.SOUTH);
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    frame.getContentPane().add(this);
    frame.pack();
    frame.setSize(500,600);
    frame.setVisible(true);
         public static void main(String args[]) {
              new ViewerQCM();
    }

    hi,
    there is some problem with JedtorPane when you update the page. Image or not updated all the time because the buffer keep the old image and does not update it. The problem is that class got to much protected field so you cannot change nothing. It is a bug since Two years and no body as correct it.

  • How do I search a spreadsheet for a list of URL's | then search those URL's for keywords | save the output? (Oh yeah..., and schedule it)

    Fist, I should mention I am not a programmer but am eagerly learning powershell!
    I am looking for an automated solution to accomplish what I am currently doing manually.  I need a script that would combine the following:
    Reach out to a list of websites (probably a loop of some sort since the list will come out of a spreadsheet which could contain 1 or 100 different sites)
    Search each page for a specific word or words (not contained in the spreadsheet though that may make it more scalable)
    Save the URL of the site(s) that contained the keywords to one text file (versus the multiple .html files I am creating today)
    Have the output contain which words it found on which site.
    If not overly complicated, I would like to schedule this to recur once a week.
    A working script would be ideal, but even the resources that show me how to incorporate each element would suffice.
    I have had success pulling down the full content of the listed pages and saving them to a directory, which requires manual intervention.
    So far this works, but it's not scalable:
         Set-ExecutionPolicy RemoteSigned
         $web = New-Object Net.WebClient
         $web.DownloadString("http://sosomesite/54321.com") | Out-File "C:\savestuffhere\54321.html"
         $web.DownloadString("http://sosomesite/54321.com") | Out-File "C:\savestuffhere\65432.html"
         Get-ChildItem -Path "C:\savestuffhere\" -Include *.html -Recurse | Select-String -Pattern "Keyword 1"
    In otherwords, I have to manually replace the "http://sosomesite/54321.com" and "C:\savestuffhere\54321.html" when the URL changes to .\65432.com and the output name to match.  That works fine when it's a couple sites, but again,
    is not scalable.  
    Then, to see if any of the saved file's contain the keyword(s), I have to search the directory for the keyword which I am using:
    Get-ChildItem -Path "C:\savestuffhere\54321.html" -Include *.html -Recurse | Select-String -Pattern "Keyword 1"

    Hi Sure-man,
    Sorry for the delay reply.
    To automatically Reach out to all urls, you can list all urls in a txt file "d:\urls.txt" like this:
    http://sosomesite/54321.com
    http://sosomesite/65432.com
    Then please try the script below to save the URL of the site(s) that contained the keywords to one text file "d:\outputurls.txt":
    $urls = get-content d:\urls.txt
    foreach($url in $urls){
    $results = $web.DownloadString("$url")
    $matches = $results | Select-String -Pattern "keyword1","keyword2"
    #Extract the text of the messages, which are contained in segments that look like keyword1 or keyword2.
    if ($matches.Matches){
    $Object = New-Object PSObject
    $Object | add-member Noteproperty keyword $matches.Matches.value
    $Object | add-member Noteproperty URL $url
    $output+=$Object}
    $output|Out-File d:\outputurls.txt
    If you want to schduled this script in Task Scheduler once a week, please save the script above as .ps1 file, and follow this article:
    Weekend Scripter: Use the Windows Task Scheduler to Run a Windows PowerShell Script
    If I have any misunderstanding, please let me know.
    I hope this helps.

  • I want to stop it going to OpenDNS when I type a word in the url area. I want it to go to google.

    I want to stop it going to OpenDNS when I type a word in the url area. I want it to go to Google.
    I have changed the keyword.URL to http://www.google.com.my/search?q=
    But this only works for terms with a space in it. For example:
    Typing: "word1 word2" will go to Google
    Typing: "word" Goes to OpenDNS
    Furthermore... If I type in "eBay" it will take me to eBay.com (as I would expect) but if I type in another site like "tip20" it goes to OpenDNS.
    How do I fix this once and for all.

    Use a keyword search via the location bar.<br />
    You can add a keyword to a search engine if you click the search engine icon on the search bar and open Manage Search Engines. Select a search engine and click the "Edit Keyword" button. You can use a one letter keyword like g for Google.<br />
    Then you can type <b>g word</b> or <b>g word1 word2</b> in the location bar to do a search.

  • I would like to be able to take a website that I use ofter and drop it on the firefox screen below the url. Then I will have a quick access. How do I do this?

    Question
    I would like to be able to take a website that I use ofter and drop it on the firefox screen below the url. Then I will have a quick access. How do I do this? I currently use this on my laptop, but recently bought a new computer and downloaded firefox and lost a lot of features that I enjoyed.

    Hi Ruthannw,
    I think you are talking about the [[Bookmarks Toolbar]]. That article will show you how to add sites to the toolbar and even how to display the toolbar if it is hidden in your new Firefox install.
    Hopefully this helps!

  • JEditorPane, setPage and EDT

    The setPage(URL url) method for JEditorPane creates a thread and then loads the URL specified. In our software we're using something to check if all work dealing with Swing components is being done on the EDT. The code for this can be found here:
    http://www.clientjava.com/blog/2004/08/20/1093059428000.html
    Anyway, it turns out that the setPage method is not doing its work on the EDT, which seems like a bug since modifying a component off the EDT can lead to problems. Anyone want to shed some light on this topic or tell me if there's anything that can be done about it? Thanks.

    I am using setPage(URL) method to display files selected from a fileTree.
    I am facing a file locking problem, because of the the PageLoader thread spawned by the setPage method.
    The file is locked temporarily some times and prevents other applications to edit it.
    Can anyone help me what should I do to solve this problem?

  • JEditorPane.setPage - detecting that asynchronous image loading is complete

    Hi,
    I'm using a JEditorPane to load and display an html page of a url by using
    setPage(String url) ... and I've added a progress bar to show the user that loading is still occuring.
    Currently i'm detecting that the page has finished loaded by listening for the property change event named "page", like this:
        this.viewEditorPane.addPropertyChangeListener(
          new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent event) {
              if (event.getPropertyName().equals("page")) {
                loadingProgressBar.setIndeterminate(false);
                System.out.println("... finished loading");
          });I appreciate that images are loaded asynchronously.
    So what I'm wondering is how I can detect that all these associated images have also completed loading?
    Thanks ... Dougall

    if you want to load images synchronously you can use like, (i got it from this forum only)
    public class SynchronousHTMLEditorKit extends HTMLEditorKit {
        public SynchronousHTMLEditorKit() {
        public ViewFactory getViewFactory() {
            return new SynchronousImageViewFactory(super.getViewFactory());
        static class SynchronousImageViewFactory implements ViewFactory {
            ViewFactory impl;
            SynchronousImageViewFactory(ViewFactory impl) {
                this.impl = impl;
            public View create(Element elem) {
                View v = impl.create(elem);
                if((v != null) && (v instanceof ImageView)) {
                    ((ImageView)v).setLoadsSynchronously(true);
                return v;
    }

  • JEditorPane.setPage halting other threads

    I'm in the process of creating a program which loads a html-file while I'm running another process at the same time. It seems like setPage halts my process after a short while.
    As an example I slightly altered a piece from a tutorial (http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-JEditorPane.html)
    to include a button which is counted down with the help of a timer. As you can see, it's halted for about a second or so after a short while.
    Is there any way I can keep the countdown going fluently?
    import javax.swing.*;
    import javax.swing.event.*;
    //import com.inbis.invitt.SimpleBrowser.ButtonDelayer;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    public class Browser extends JFrame implements HyperlinkListener, ActionListener {
    private JButton homeButton;
    private JTextField urlField;
    private JEditorPane htmlPane;
    private String initialURL;
    private Timer timer;
    public Browser(String initialURL) {
    super("Simple Swing Browser");
    this.initialURL = initialURL;
    addWindowListener(new WindowListener() {
    public void windowActivated(WindowEvent e) {
    public void windowClosed(WindowEvent e) {
    System.exit(0);
    public void windowClosing(WindowEvent e) {
    public void windowDeactivated(WindowEvent e) {
    public void windowDeiconified(WindowEvent e) {
    public void windowIconified(WindowEvent e) {
    public void windowOpened(WindowEvent e) {
    JPanel topPanel = new JPanel();
    topPanel.setBackground(Color.lightGray);
    homeButton = new JButton("Home");
    countdownButton(homeButton, 100, 100);
    JLabel urlLabel = new JLabel("URL:");
    urlField = new JTextField(30);
    urlField.setText(initialURL);
    urlField.addActionListener(this);
    topPanel.add(homeButton);
    topPanel.add(urlLabel);
    topPanel.add(urlField);
    getContentPane().add(topPanel, BorderLayout.NORTH);
    try {
    htmlPane = new JEditorPane(initialURL);
    htmlPane.setEditable(false);
    htmlPane.addHyperlinkListener(this);
    JScrollPane scrollPane = new JScrollPane(htmlPane);
    getContentPane().add(scrollPane, BorderLayout.CENTER);
    } catch (IOException ioe) {
    warnUser("Can't build HTML pane for " + initialURL + ": " + ioe);
    Dimension screenSize = getToolkit().getScreenSize();
    int width = screenSize.width * 8 / 10;
    int height = screenSize.height * 8 / 10;
    setBounds(width / 8, height / 8, width, height);
    setVisible(true);
    public void actionPerformed(ActionEvent event) {
    String url;
    if (event.getSource() == urlField)
    url = urlField.getText();
    else
    // Clicked "home" button instead of entering URL
    url = initialURL;
    try {
    htmlPane.setPage(new URL(url));
    urlField.setText(url);
    } catch (IOException ioe) {
    warnUser("Can't follow link to " + url + ": " + ioe);
    public void hyperlinkUpdate(HyperlinkEvent event) {
    if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    try {
    htmlPane.setPage(event.getURL());
    urlField.setText(event.getURL().toExternalForm());
    } catch (IOException ioe) {
    warnUser("Can't follow link to " + event.getURL().toExternalForm() + ": " + ioe);
    private void warnUser(String message) {
    JOptionPane.showMessageDialog(this, message, "Error", JOptionPane.ERROR_MESSAGE);
    public static void main(String[] args) {
    new Browser("http://www.sun.com/");
    public void countdownButton(JButton button, int delayMs, int delaysToPass) {
    ButtonDecreaser buttonDecreaser = new ButtonDecreaser(button, delaysToPass);
    timer = new Timer(delayMs, buttonDecreaser);
    timer.setInitialDelay(0);
    timer.start();
    private class ButtonDecreaser implements ActionListener {
    private int delayAmount;
    private JButton button;
    public ButtonDecreaser(JButton button, int delayAmount) {
    this.delayAmount = delayAmount;
    this.button = button;
    public void actionPerformed(ActionEvent evt) {
    if (delayAmount > 0) {
    button.setText(Integer.toString(delayAmount));
    } else {
    button.setText("Finished");
    timer.stop();
    delayAmount--;
    }

    Thank you very much for the replies so far. :)
    I am currently on a machine with duo-core, but I'd like to make my program compatible with the ones with single as well anyways. I guess I could find a way to have the processes run sequentially instead of parallely, but it would be really neat if I could get it working as I've intended. :)
    As for the code: sorry, my bad. Just tried to edit my original post without any luck. Here it is in proper format:
    import javax.swing.*;
    import javax.swing.event.*;
    //import com.inbis.invitt.SimpleBrowser.ButtonDelayer;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    public class Browser extends JFrame implements HyperlinkListener, ActionListener {
      private JButton homeButton;
      private JTextField urlField;
      private JEditorPane htmlPane;
      private String initialURL;
      private Timer timer;
      public Browser(String initialURL) {
        super("Simple Swing Browser");
        this.initialURL = initialURL;
        addWindowListener(new WindowListener() {
          public void windowActivated(WindowEvent e) {
          public void windowClosed(WindowEvent e) {
            System.exit(0);
          public void windowClosing(WindowEvent e) {
          public void windowDeactivated(WindowEvent e) {
          public void windowDeiconified(WindowEvent e) {
          public void windowIconified(WindowEvent e) {
          public void windowOpened(WindowEvent e) {
        JPanel topPanel = new JPanel();
        topPanel.setBackground(Color.lightGray);
        homeButton = new JButton("Home");
        countdownButton(homeButton, 100, 100);
        JLabel urlLabel = new JLabel("URL:");
        urlField = new JTextField(30);
        urlField.setText(initialURL);
        urlField.addActionListener(this);
        topPanel.add(homeButton);
        topPanel.add(urlLabel);
        topPanel.add(urlField);
        getContentPane().add(topPanel, BorderLayout.NORTH);
        try {
          htmlPane = new JEditorPane(initialURL);
          htmlPane.setEditable(false);
          htmlPane.addHyperlinkListener(this);
          JScrollPane scrollPane = new JScrollPane(htmlPane);
          getContentPane().add(scrollPane, BorderLayout.CENTER);
        } catch (IOException ioe) {
          warnUser("Can't build HTML pane for " + initialURL + ": " + ioe);
        Dimension screenSize = getToolkit().getScreenSize();
        int width = screenSize.width * 8 / 10;
        int height = screenSize.height * 8 / 10;
        setBounds(width / 8, height / 8, width, height);
        setVisible(true);
      public void actionPerformed(ActionEvent event) {
        String url;
        if (event.getSource() == urlField)
          url = urlField.getText();
        else
          // Clicked "home" button instead of entering URL
          url = initialURL;
        try {
          htmlPane.setPage(new URL(url));
          urlField.setText(url);
        } catch (IOException ioe) {
          warnUser("Can't follow link to " + url + ": " + ioe);
      public void hyperlinkUpdate(HyperlinkEvent event) {
        if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
          try {
            htmlPane.setPage(event.getURL());
            urlField.setText(event.getURL().toExternalForm());
          } catch (IOException ioe) {
            warnUser("Can't follow link to " + event.getURL().toExternalForm() + ": " + ioe);
      private void warnUser(String message) {
        JOptionPane.showMessageDialog(this, message, "Error", JOptionPane.ERROR_MESSAGE);
      public static void main(String[] args) {
        new Browser("http://www.sun.com/");
      public void countdownButton(JButton button, int delayMs, int delaysToPass) {
        ButtonDecreaser buttonDecreaser = new ButtonDecreaser(button, delaysToPass);
        timer = new Timer(delayMs, buttonDecreaser);
        timer.setInitialDelay(0);
        timer.start();
      private class ButtonDecreaser implements ActionListener {
        private int delayAmount;
        private JButton button;
        public ButtonDecreaser(JButton button, int delayAmount) {
          this.delayAmount = delayAmount;
          this.button = button;
        public void actionPerformed(ActionEvent evt) {
          if (delayAmount > 0) {
            button.setText(Integer.toString(delayAmount));
          } else {
            button.setText("Finished");
            timer.stop();
          delayAmount--;
    }

  • Search Engine keyword.url, URL

    How would I figure out what the search engine's URL is if I wanted to add it to the keyword.url? I know the main search engine's URL's for keyword.url, but what if I wanted to use another search engine in the awesome bar that isn't popular?

    You can right-click the search bar on the page and use add a keyword for this search to create a bookmark for that particular search engine to see its URL.
    Then you can use that URL without the %s parameter for the keyword.URL pref (reorder the GET parameter is the query parameter is not the last).
    *http://kb.mozillazine.org/Keyword.URL
    *http://kb.mozillazine.org/Using_keyword_searches
    *http://kb.mozillazine.org/List_of_keyword_searches

  • Error message pops up:  url files of type "file:" are not supported.  How can I get rid of this?

    Error message pops up:  url files of type "file:" are not supported.  How can I get rid of this?

    Open the Time Machine pane in System Preferences. If it shows that Time Machine is ON, click the padlock icon in the lower left corner, if necessary, to unlock it. Scroll to the bottom of the list of backup drives and click Add or Remove Backup Disk. Remove all the disks, then add them back. Quit System Preferences. Test.

  • Applet.getImage(URL url) question

    Hi,
    I experienced delays of up to several hundreds milliseconds for calling Applet.getImage(URL url) when accessing an image the first time.
    The API states that "This method always returns immediately, whether or not the image exists." but this does not seem to be correct. In contrast, Applet.getToolkit().getImage() returns immediately.
    What are the differences between these two methods?
    What caching mechanisms (browser, SUN cache) are running behind the scenes?
    Used environment: IE6/Java1.5, IE6/Java1.6, Firefox2/Java1.6 ...all running under WinXP.
    Thank you so much!

    I have had exactly the same problem with Applet.getImage.
    In previous JRE versions, Applet.getImage returned immediately,
    but this has apparently changed (I don't know at which version).
    I had to rewrite my program to use Applet.getToolkit().getImage
    - then the program worked as before...
    Looks like a bug to me.
    H�vard Tveite

  • I have been using itunes all day and then it wanted me to install a newer version.  When I did it said I can't because it's missing mdsvr80 or something so i downloaded that now it has another error.  How do I get itunes back the way it was or to work?

    I have been using itunes all day and then it wanted me to install a newer version.  When I did it said I can't because it's missing mdsvr80 or something so i downloaded that now it has another error.  How do I get itunes back the way it was or to work?

    See this User Tip by turingtest2
    https://discussions.apple.com/docs/DOC-6562

  • My Iphone 4 just updated to the iOS6.  I've connected it to my computer for the first time since then, and wanted to back up my photos in iPhoto.  However, although Iphoto recognized my phone, it shows no photos to upload or backup. ??

    My Iphone 4 just updated to the iOS6.  I've connected it to my computer for the first time since then, and wanted to back up my photos in iPhoto.  However, although Iphoto recognized my phone, it shows no photos to upload or backup.  It lists my phone in the "devices" category on the left bar, but no longer shows any of my photos.
    Does anyone have any suggestions?

    I've reread your question several times and am not sure I understand it.
    Are you trying to basically start over, as if you just took your iPhone out of the box?  If so, do:
    Settings > General > Reset > Erase all content and settings

  • I create an apple id then i want to verify it, i verify it once then  when i log in with my apple id it asked mi again to verify it.everytime i log in it asked me to resend verication and after i resend it i press done. Please can anyone help me ?

    I create an apple id then i want to verify it, i verify it once then  when i log in with my apple id it asked mi again to verify it.everytime i log in it asked me to resend verication and after i resend it i press done. Please can anyone help me ?

    How are you verifying it?  Are you responding to the email that is sent?  If not, do so.
    If so, then try changing your password.

Maybe you are looking for

  • WRT54G3G-ST router - no internet connection - can't reset router

    Hello.  Definite longer story definitely not short (I apologize for the rambling length...  I don't know what is and isn't important, so scan at will, please...  I am sorry...):  Recently my computer (Dell XPS 400, Windows XP Service Pack 3, Internet

  • How to Get Alternative Gl Account Number in SRM from ECC backend

    Hi All ,   We need to get the Alternative Account Number in the SRM  from the ECC backend.  Is it stored in any of the SRM Table?   or   is ther any  RFC(FM) or BAPI to get the Alternative Account Number from the Ecc to SRM.   Please help. Regards Ch

  • How can I get videos filmed on my iPhone 5 on to my iPad

    how can I get videos filmed on my iPhone 5 on to my iPad cos iMovie on my mac (2011 mini 2.3ghz 8gb ram) is painful so want to use iMovie on ipad? cheers

  • Quicktime has broken iTunes - HELP!

    Earlier today I opened iTunes and was about to buys some videos for my iPod. There was a notice at the top of the itunes store screen that said I needed to update Quicktime & iTunes in order to play & buy the videos. I clicked and followed the on scr

  • Availability Check / Sales Order / Planning Strategy 50

    Hi, the material master has been setup with planning strategy 50. now if i sales order is created. the system directly created planned order for the sales order quantity. Now, there is smtimes a situation that some stock is already present in unrestr