Package javax.swing

Examples of javax.swing.ImageIcon


        if (url == null) {
            url = getClassToUseForIconRetrieval().getResource(iconName);
        }

        if (url != null) {
            guiIcon = new ImageIcon(url);
        }
    }
View Full Code Here


            try {
                if (imageURLString != null && !imageURLString.equals("")) {
                    URL imageURL = PropUtils.getResourceOrFileOrURL(this,
                            imageURLString);
                    ImageIcon imageIcon = new ImageIcon(imageURL);
                    spatialIndex.setPointIcon(imageIcon);
                }
            } catch (MalformedURLException murle) {
                Debug.error("ShapeLayer.setFileProperties: point image URL not so good: \n\t"
                        + imageURLString);
View Full Code Here

     * @param url URL for image
     * @param info tool tip
     * @param al ActionListener
     */
    public void addButton(URL url, String info, ActionListener al) {
        JButton b = new JButton(new ImageIcon(url, info));
        b.setToolTipText(info);
        b.setMargin(new Insets(0, 0, 0, 0));
        b.addActionListener(al);
        b.setBorderPainted(false);
        add(b);
View Full Code Here

            }
           
            int descDir = -1; // this description direction

            ButtonGroup group = new ButtonGroup();
            ImageIcon ii = createArrowIcon(new BasicStroke(1), 50, 20, descDir);
            JRadioButtonMenuItem button = new JRadioButtonMenuItem(ii, !doArrowHead);
            button.setActionCommand(String.valueOf(descDir));
            group.add(button);
            button.addActionListener(listener);
            arrowheadMenu.add(button);
View Full Code Here

                    middleY, upTip, downTip }, 3);
            g.fill(poly);
            g.draw(poly); // Seems to help with rendering problem.
        }

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

        if (Debug.debugging("bufferedimage")) {
            Debug.output("BufferedImageHelper.getBufferedImage(URL) can't use JAI, using ImageIcon");
        }

        // if JAI is not installed....
        ImageIcon ii = new ImageIcon(url);
        if (w <= 0)
            w = ii.getIconWidth();
        if (h <= 0)
            h = ii.getIconHeight();
        return getBufferedImage(ii.getImage(),
                x,
                y,
                w,
                h,
                BufferedImage.TYPE_INT_ARGB);
View Full Code Here

        if (Debug.debugging("bufferedimage")) {
            Debug.output("BufferedImageHelper.getBufferedImage(path) can't use JAI, using ImageIcon");
        }

        // if JAI is not installed....
        ImageIcon ii = new ImageIcon(path);
        if (w <= 0)
            w = ii.getIconWidth();
        if (h <= 0)
            h = ii.getIconHeight();
        return getBufferedImage(ii.getImage(),
                x,
                y,
                w,
                h,
                BufferedImage.TYPE_INT_ARGB);
View Full Code Here

    public JButton getLaunchButton() {
        if (launchButton == null) {
//            BasicStroke bs = getBasicStroke();
//            float buttonHeight = (bs == null ? 11 : bs.getLineWidth() + 10f);
            float buttonHeight = 20;
            ImageIcon icon = createIcon(getBasicStroke(),
                    40,
                    (int) buttonHeight,
                    true);
            launchButton = new JButton(icon);
            launchButton.setToolTipText("Modify Line Stroke");
View Full Code Here

            g.drawLine(0, height / 2, width, height / 2);
        } else {
            g.drawLine(width / 2, 0, width / 2, height);
        }

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

        while (it.hasNext()) {
            EditToolLoader loader = (EditToolLoader) it.next();
            String[] classnames = loader.getEditableClasses();

            for (int i = 0; i < classnames.length; i++) {
                ImageIcon icon = loader.getIcon(classnames[i]);
                JToggleButton btn = new JToggleButton(icon, false);
                btn.setToolTipText(loader.getPrettyName(classnames[i]));
                btn.setActionCommand(classnames[i]);
                btn.addActionListener(this);
                bg.add(btn);
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.