Search in sources :

Example 61 with ImageIcon

use of javax.swing.ImageIcon in project zaproxy by zaproxy.

the class ExtensionAutoUpdate method getAddonsButton.

private JButton getAddonsButton() {
    if (addonsButton == null) {
        addonsButton = new JButton();
        addonsButton.setIcon(new ImageIcon(ExtensionAutoUpdate.class.getResource("/resource/icon/fugue/block.png")));
        addonsButton.setToolTipText(Constant.messages.getString("cfu.button.addons.browse"));
        addonsButton.setEnabled(true);
        addonsButton.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                getAddOnsDialog().setVisible(true);
            }
        });
    }
    return this.addonsButton;
}
Also used : ImageIcon(javax.swing.ImageIcon) ActionListener(java.awt.event.ActionListener) JButton(javax.swing.JButton) ActionEvent(java.awt.event.ActionEvent)

Example 62 with ImageIcon

use of javax.swing.ImageIcon in project zaproxy by zaproxy.

the class View method getResponsePanel.

@Override
public HttpPanelResponse getResponsePanel() {
    if (responsePanel == null) {
        // ZAP: constructor changed
        responsePanel = new HttpPanelResponse(false, OptionsParamView.BASE_VIEW_KEY + ".main.");
        // ZAP: Added 'left arrow' icon
        responsePanel.setIcon(new ImageIcon(View.class.getResource("/resource/icon/16/106.png")));
        // ZAP: i18n
        responsePanel.setName(Constant.messages.getString("http.panel.response.title"));
        responsePanel.setEnableViewSelect(false);
        responsePanel.loadConfig(Model.getSingleton().getOptionsParam().getConfig());
        responsePanel.setDefaultAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | Event.ALT_MASK | Event.SHIFT_MASK, false));
        responsePanel.setMnemonic(Constant.messages.getChar("http.panel.response.mnemonic"));
    }
    return responsePanel;
}
Also used : ImageIcon(javax.swing.ImageIcon) HttpPanelResponse(org.zaproxy.zap.extension.httppanel.HttpPanelResponse)

Example 63 with ImageIcon

use of javax.swing.ImageIcon in project OpenAM by OpenRock.

the class CheckBoxListCellRenderer method getListCellRendererComponent.

public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    CheckBoxListEntry entry = (CheckBoxListEntry) value;
    setText(entry.getName());
    ImageIcon icon;
    if (isSelected) {
        icon = entry.getSelectedImage();
    } else {
        icon = entry.getNotSelectedImage();
    }
    setIcon(icon);
    return this;
}
Also used : ImageIcon(javax.swing.ImageIcon)

Example 64 with ImageIcon

use of javax.swing.ImageIcon in project OpenAM by OpenRock.

the class LabelTableCellRenderer method getTableCellRendererComponent.

public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int colimn) {
    if (value == null) {
        setText(null);
        setIcon(null);
        setForeground(Color.BLACK);
        return this;
    }
    if (value instanceof LabelTableCell) {
        String text;
        if ((text = ((LabelTableCell) value).getText()) != null) {
            setText(text);
        }
        ImageIcon icon;
        if ((icon = ((LabelTableCell) value).getIcon()) != null) {
            setIcon(icon);
        }
        setForeground(((LabelTableCell) value).getColor());
    }
    return this;
}
Also used : ImageIcon(javax.swing.ImageIcon)

Example 65 with ImageIcon

use of javax.swing.ImageIcon in project pcgen by PCGen.

the class ImageFileChooserPreview method loadImage.

/** Loads a new image into the preview window, and scales it if necessary.
	 */
private void loadImage() {
    if (imageFile == null) {
        imageThumb = null;
        return;
    }
    imageThumb = new ImageIcon(imageFile.getPath());
    // Check if thumb requires scaling
    if ((imageThumb.getIconHeight() < previewHeight) && (imageThumb.getIconWidth() < previewWidth)) {
        return;
    }
    int w = previewWidth;
    int h = previewHeight;
    if (imageThumb.getIconHeight() > imageThumb.getIconWidth()) {
        w = -1;
    } else {
        h = -1;
    }
    imageThumb = new ImageIcon(imageThumb.getImage().getScaledInstance(w, h, Image.SCALE_DEFAULT));
}
Also used : ImageIcon(javax.swing.ImageIcon)

Aggregations

ImageIcon (javax.swing.ImageIcon)427 JButton (javax.swing.JButton)109 ActionEvent (java.awt.event.ActionEvent)83 ActionListener (java.awt.event.ActionListener)70 JLabel (javax.swing.JLabel)67 Dimension (java.awt.Dimension)62 BufferedImage (java.awt.image.BufferedImage)51 JPanel (javax.swing.JPanel)48 Insets (java.awt.Insets)42 Image (java.awt.Image)31 BorderLayout (java.awt.BorderLayout)28 IOException (java.io.IOException)28 URL (java.net.URL)26 GridBagLayout (java.awt.GridBagLayout)23 JMenuItem (javax.swing.JMenuItem)23 Color (java.awt.Color)21 Point (java.awt.Point)21 LogTypeHelper (com.cosylab.logging.engine.log.LogTypeHelper)20 JToggleButton (javax.swing.JToggleButton)20 JScrollPane (javax.swing.JScrollPane)19