Package javax.swing

Examples of javax.swing.ImageIcon


  /**
   * Get the Icon for this Tab
   * @return Icon
   */
  public Icon getIcon() {
    return new ImageIcon(ImageUtilities.createImageFromJar("knotifyplugin/knotify.png", KNotifySettingsTab.class));
  }
View Full Code Here


    return mPluginInfo;
  }

  public ActionMenu getContextMenuActions(final Program program) {
    ImageIcon icon = createImageIcon("apps", "internet-web-browser", TVBrowserIcons.SIZE_SMALL);

    if (mConfigs.length > 1) {
      ArrayList<AbstractAction> list = new ArrayList<AbstractAction>();

      for (final AbstractPluginProgramFormating config : mConfigs) {
View Full Code Here

            e.printStackTrace();
          }
        }

        if ((img.getWidth(null) != 16) || (img.getHeight(null) != 16)) {
          img = ((ImageIcon) UiUtilities.scaleIcon(new ImageIcon(img), 16, 16))
              .getImage();
        }

        ImageIO.write(renderImage(img), "png", file);
        try {
View Full Code Here

  public static Version getVersion() {
    return mVersion;
  }

  public Icon[] getMarkIconsForProgram(final Program p) {
    return new Icon[] {new ImageIcon(ImageUtilities.createImageFromJar("knotifyplugin/knotify.png", KNotifySettingsTab.class))};
  }
View Full Code Here

    tabbedPanel = new TabbedPanel(this.langProp);
    statusBar = new StatusBar(this.langProp);

    //Create the frame
    this.setTitle(this.langProp.getValue("frameTitle"));
    logo = new ImageIcon("images/hamsam.gif");
    this.setIconImage(logo.getImage());
    this.getContentPane().setLayout(layout);
    this.getContentPane().add(menuBar, BorderLayout.NORTH);
    this.getContentPane().add(tabbedPanel, BorderLayout.CENTER);
    this.getContentPane().add(statusBar, BorderLayout.SOUTH);
View Full Code Here

            }
          }
        } else if (iconPluginArr[pluginIdx].equals(Settings.PICTURE_ID)) {
          // picture icon
          if (mProgram.hasFieldValue(ProgramFieldType.PICTURE_TYPE)) {
            iconList.add(new ImageIcon("imgs/Info_HasPicture.png"));
          }
        } else if (iconPluginArr[pluginIdx].startsWith("FORMAT")) {
          // new style format (each icon separately)
          if ((info != -1) && (info != 0)) {
            int index = Integer.valueOf(iconPluginArr[pluginIdx].substring(7));
View Full Code Here

      g2.setTransform(z);
      icon.paintIcon(null, g2, 0, 0);
      g2.dispose();
      BufferedImage scaled = scaleDown(iconImage, width, height);
      // Return new Icon
      return new ImageIcon(scaled);
    } catch (Exception ex) {
      ex.printStackTrace();
    }

    return icon;
View Full Code Here

   */
  public static ImageIcon createChannelIcon(Icon ic) {
    BufferedImage img = new BufferedImage(getChannelIconWidth(), getChannelIconHeight(), BufferedImage.TYPE_INT_RGB);

    if (ic == null) {
      ic = new ImageIcon("./imgs/tvbrowser16.png");
    }

    int height = 20;
    int width = 40;

    if ((ic.getIconWidth() != 0) && (ic.getIconHeight() != 0)) {
      double iWidth = ic.getIconWidth();
      double iHeight = ic.getIconHeight();
      if (iWidth / iHeight < 2.0) {
        width = (int) (iWidth * (20.0 / iHeight));
      } else {
        height = (int) (iHeight * (40.0 / iWidth));
      }
    }
    ic = scaleIcon(ic, width, height);

    Graphics2D g = img.createGraphics();

    g.setColor(Color.WHITE);
    g.fillRect(1, 1, 40, 20);

    int x = 1 + 20 - ic.getIconWidth() / 2;
    int y = 1 + 10 - ic.getIconHeight() / 2;

    ic.paintIcon(null, g, x, y);

    g.setColor(Color.BLACK);
    g.drawRect(0, 0, 42, 22);

    return new ImageIcon(img);
  }
View Full Code Here

   
    // These next two lines set it up so that the explorer window shows a
    // customized icon representing the component type. This should be a
    // 16x16 image.
    URL url = getClass().getClassLoader().getResource("com/cburch/gray/counter.gif");
    if (url != null) setIcon(new ImageIcon(url));
  }
View Full Code Here

    Image img = createImageFromJar(fileName, srcClass);
   
    if (img == null) {
      return null;
    } else {
      return new ImageIcon(img);
    }
  }
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.