Current Position:Home > JLabel Icon Update Question

JLabel Icon Update Question

Update:11-30Source: network consolidation
Advertisement
Hi. I have created a jLabel that get's it's Icon updated via a value derived from a MYSQL query. The Icon1 value is a URL. My question is, if I do the MYSQL query and the URL doesn't change from the existing value, does the jLabel still go out and pull the image over? Or does it recognize that the URL is still the same and doesn't make an attempt at pulling the image over? Basically, I am asking this because I'm trying to determine the load on my webserver. Thank you for your help!
image1.setIcon(icon1);

The Best Answer

Advertisement
Hi Daryl. Here is what I'm doing:
protected static ImageIcon createImageIcon(String URL,
                                               String description) {
        //java.net.URL imgURL = LabelDemo.class.getResource(URL);
        java.net.URL imgURL = null;
    try {
      imgURL = new java.net.URL(URL);
    } catch (Exception e) {
      //Logger.getLogger(LabelDemo.class.getName()).log(Level.SEVERE, null, ex);
        if (imgURL != null) {
            return new ImageIcon(imgURL, description);
        } else {
            System.err.println("Couldn't find file: " + URL);
            return null;
ImageIcon icon1 = createImageIcon("https://www.website.com/images/" + dateVal + "/thumbs/" + image2Val + "",
                   image1.setIcon(icon1);
  • JLabel Icon Update Question Update:11-30

    Hi. I have created a jLabel that get's it's Icon updated via a value derived from a MYSQL query. The Icon1 value is a URL. My question is, if I do the MYSQL query and the URL doesn't change from the existing value, does the jLabel still go out and pu

  • Can we make things more Useful...? not an update question. Update:11-30

    Ok well i said its not an update question.. well it kinda is. today is friday.. the release date of the new iphone 3g.. great.. i love my iphone.. im goin to wait a week or so before i go ahead and buy the new phone for sake of bugs and lil tweaks..

  • Updated question: Both Mac & PC links possible?? Update:11-30

    I apologize right away for posting a new topic with my updated question. But I realized I didn't phrase it right to get any help. The question is - is it possible make both Mac links and PC links available on one disk. They would be in separate chapt

  • Software Update Questions Update:11-30

    Hi everybody, I'm still relatively green in the computer world, so, I'm sure these questions are way to "rookie" for you. Nevertheless; here they are. Software Update Questions: 1. What is J2SE 5.0 Release 4, version 4.0 (39.3 MB) and, is it nec

  • EFI Update Question Update:10-11

    Hey all. I just have a question about the EFI update that i have been promted to install via the update function on my new MBP 2011. But then when i read witch models that are affected, then my model is not amoung the affected models, so why do i nee

  • Flash Player installation and update questions and answers Update:10-11

    How do I verify that I have the latest version of Flash Player? If you receive a message that tells you that Flash Player is out of date or a new version of Flash Player is available, you can verify this by visiting the Flash Player Help page with yo

  • Acrobat 9.5.2 update questions Update:10-11

    Nov. 15, 2012 - As Adobe sends there update notices, I updated yesterday morning and lost all functionality.  Couldn't open a PDF, kept getting messages that my license had expired.  Called Customer Support and after an hour on the phone, we uninstal

  • A Tiger Software Update Question from the iBook Forum Update:11-30

    I just finished reading this question, http://discussions.apple.com/thread.jspa?messageID=12901184#12901184 in the iBook G4 forum and am very curious myself if this could be a problem with the update. If someone knows why this is happening, would you

  • Patch 8833297 - 11.1.0.7.1 Patch Set Update question. Update:11-30

    Hi The O.S oul5x64 database version 11.1.0.7.0 after applied this patch Patch 8833297 - 11.1.0.7.1 Patch Set Update and went thru the post installation procedure. SQL> select * from v$version; BANNER Oracle Database 11g Enterprise Edition Release 11.

  • Quick windows update question Update:11-30

    I searched and couldn't find exactly what I was looking for. So I installed windows xp SP3, and so far it's going good. My question is will any of the normal windows updates mess up anything at this point.Ruka: You installed SP3 update and Windows is