Java ImageIcon setImageIcon(ImageIcon icon, String description)

Here you can find the source of setImageIcon(ImageIcon icon, String description)

Description

set Image Icon

License

Open Source License

Return

ImageIcon, or null if the path was invalid.

Declaration

static public ImageIcon setImageIcon(ImageIcon icon, String description) 

Method Source Code

//package com.java2s;
/*/*from www  .java 2  s .c  om*/
Copyright 2007-2009 QSpin - www.qspin.be
    
This file is part of QTaste framework.
    
QTaste is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
    
QTaste is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.
    
You should have received a copy of the GNU Lesser General Public License
along with QTaste. If not, see <http://www.gnu.org/licenses/>.
*/

import javax.swing.ImageIcon;

public class Main {
    /**
     * @return ImageIcon, or null if the path was invalid.
     */
    static public ImageIcon setImageIcon(ImageIcon icon, String description) {
        if (icon == null)
            return icon;
        icon.setDescription(description);
        return icon;
    }
}

Related

  1. paintWithWatermarkHelper(JComponent component, ImageIcon watermark, Graphics g)
  2. parseImageIcon(Image image)
  3. prepareImage(ImageIcon icon, int x, int y)
  4. saveImage(ImageIcon picture, String targetfile)
  5. setDefaultImageIcons(Window window)
  6. setImageIcon(JLabel label, URL url)
  7. SetStandardSizeForImage(ImageIcon icon)
  8. setVerBumpIcon(ImageIcon icon)
  9. showLogo(ImageIcon logo)