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;
}
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;
}
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;
}
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;
}
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));
}
Aggregations