Package javax.swing

Examples of javax.swing.ImageIcon


        g.setColor(Color.WHITE);
        g.fillRect(0,0,50,10);
        g.setColor(mColor);
        g.fillRect(0,0,50,10);
       
        ImageIcon icon = new ImageIcon(img);
       
        return icon;
    }
View Full Code Here


    /**
     * Returns the name of the tab-sheet.
     */
    public Icon getIcon() {
      return new ImageIcon("imgs/Jar16.gif");
    }
View Full Code Here

  private IconPlugin[] getAvailableIconPlugins() {
    final ArrayList<IconPlugin> list = new ArrayList<IconPlugin>();

    list.addAll(getFormatIconNames());
    list.add(new IconPlugin(PICTURE_ICON_NAME, new ImageIcon("imgs/Info_HasPicture.png")));

    for (PluginProxy plugin : PluginProxyManager.getInstance().getActivatedPlugins()) {
      final String iconText = plugin.getProgramTableIconText();
      if (iconText != null) {
        Icon[] icons = plugin.getProgramTableIcons(PluginManagerImpl.getInstance().getExampleProgram());
View Full Code Here

*
* @return the image icon
*/
public ImageIcon getVisibleImageIcon() {
    if (imageIcon == null && value != null)
  imageIcon = new ImageIcon(getImageURL());
    return imageIcon;
}
View Full Code Here

*
* @return a dimmed version of the the image icon
*/
public ImageIcon getHiddenImageIcon() {
    if (hiddenImageIcon == null && value != null && canLoad()) {
  ImageIcon ii = getVisibleImageIcon();
  if (ii != null) {
      hiddenImageIcon =
    new ImageIcon(GrayFilter.createDisabledImage(ii.getImage()));
  }
    }
    return hiddenImageIcon;
}
View Full Code Here

          }
        }
      }
    });
    menu.add(menuItem);
    ImageIcon icon = IconLoader.getInstance().getIconFromTheme("apps",
        "help-browser", 16);
    menuItem = MenuUtil.createMenuItem(Localizer.getLocalization(Localizer.I18N_HELP));
    menuItem.setIcon(icon);
    menuItem.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
View Full Code Here

      // Ensure all the bytes have been read in
      if (offset < bytes.length) {
          throw new IOException("Could not completely read file "+image);
      }

      return new ImageIcon(Toolkit.getDefaultToolkit().createImage(bytes));
    } catch (Exception e) {
    }
    return null;
  }
View Full Code Here

   *          Icon that should be loaded
   * @return Icon if found, null if no Icon was found
   */
  public ImageIcon getIconFromTheme(Plugin plugin, ThemeIcon icon) {
    // Check the Cache
    ImageIcon imageIcon = mIconCache.get(icon);
    if (imageIcon != null) {
      return imageIcon;
    }

    // First Try: Current Icon Theme
View Full Code Here

   * Get an Image from the Icon-Theme
   * @param image get this Image
   * @return Image
   */
  protected ImageIcon getImageFromTheme(String image) {
    return new ImageIcon(ImageUtilities.createImageAsynchronous(new File(getBase(), image).getAbsolutePath()));
  }
View Full Code Here

    if (image == null || image.getImageURL() == null)
  return;

    outputCellStart(image);

    ImageIcon icon = image.getImageIcon(); // For width and height
    String url = image.getImageURL().toString();
    if (url.startsWith("file:"))
  url = url.substring(5);

    // Make an alt attribute from the URL
    String alt = url;
    int pos = alt.lastIndexOf("/");
    if (pos != -1)
  alt = alt.substring(pos + 1);

    out.print("<img src=\"" + StringUtils.escapeHTML(url) + "\" alt=\""
        + StringUtils.escapeHTML(alt)
        + "\" width=\"" + icon.getIconWidth()
        + "\" height=\"" + icon.getIconHeight()
        + "\">");
    outputCellEnd();
}
View Full Code Here

TOP

Related Classes of javax.swing.ImageIcon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.