Java Code Examples for javax.swing.ImageIcon#setDescription()
The following examples show how to use
javax.swing.ImageIcon#setDescription() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BannedUsers.java From Spark with Apache License 2.0 | 6 votes |
/** * Loads all banned users in a ChatRoom. */ public void loadAllBannedUsers() { // Clear all elements from model listModel.clear(); Iterator<Affiliate> bannedUsers = null; try { bannedUsers = chat.getOutcasts().iterator(); } catch (XMPPException | SmackException | InterruptedException e) { Log.error("Error loading all banned users", e); } while (bannedUsers != null && bannedUsers.hasNext()) { Affiliate bannedUser = bannedUsers.next(); ImageIcon icon = SparkRes.getImageIcon(SparkRes.STAR_RED_IMAGE); icon.setDescription(bannedUser.getJid().toString()); listModel.addElement(icon); } }
Example 2
Source File: AboutAction.java From CQL with GNU Affero General Public License v3.0 | 5 votes |
/** * */ public static void showAboutDialog() { ImageIcon myIcon = new ImageIcon(Easik.getInstance().getFrame().getIconImage()); myIcon.setDescription("Easik"); JOptionPane.showMessageDialog(null, "EASIK - Entity Attribute Sketch Implementation Kit\n" + "Version " + Easik.VERSION + " (build r" + Easik.REVISION + ")\n" + "Developed 2005-2008 at Mount Allison University\n\n" + "R. Rosebrugh\n" + "Rob Fletcher (2005)\n" + "Vera Ranieri (2006)\n" + "Kevin Green (2006)\n" + "Jason Rhinelander (2008)\n" + "Andrew Wood (2008)\n", "Easik", JOptionPane.INFORMATION_MESSAGE, myIcon); }
Example 3
Source File: JaCoCoveragePanel.java From tikione-jacocoverage with MIT License | 5 votes |
JaCoCoveragePanel(JaCoCoverageOptionsPanelController controller) { initComponents(); try { // Add "NetBeans (default)" and "Norway Today (dark)" themes with colors preview. jComboBoxColorTheme.setRenderer(new IcoTxtComboBoxRenderer()); ImageIcon thNetBeansImg = new ImageIcon(Utils.toBytes(Globals.THEME_ICO_REGULAR)); ImageIcon thNorwaytoday = new ImageIcon(Utils.toBytes(Globals.THEME_ICO_NORWAYTODAY)); thNetBeansImg.setDescription("NetBeans (default)"); thNorwaytoday.setDescription("Norway Today"); jComboBoxColorTheme.addItem(thNetBeansImg); jComboBoxColorTheme.addItem(thNorwaytoday); jComboBoxWorkfiles.setModel(new javax.swing.DefaultComboBoxModel<>( new String[]{"keep original workfiles", "keep zipped workfiles", "delete workfiles"})); } catch (IOException ex) { Exceptions.printStackTrace(ex); } // <editor-fold defaultstate="collapsed" desc="Tooltips"> // Warning: background of tooltips is black on Ubuntu. Avoid coloring links with blue. jButtonSocialTwitter.setToolTipText("<html><body>Jonathan Lermitage on <b>Twitter</b> (author of JaCoCoverage)<br>" + "https://twitter.com/JLermitage</body></html>"); jButtonSocialFacebook.setToolTipText("<html><body>Jonathan Lermitage on <b>Facebook</b> (author of JaCoCoverage)<br>" + "https://www.facebook.com/jonathan.lermitage</body></html>"); jButtonSocialGithub.setToolTipText("<html><body>Jonathan Lermitage on <b>GitHub</b> (author of JaCoCoverage)<br>" + "https://github.com/jonathanlermitage</body></html>"); jButtonSocialJojohome.setToolTipText("<html><body>Jonathan Lermitage devblog (author of JaCoCoverage)<br>" + "http://lermitage.biz</body></html>"); jButtonOnlineHelp.setToolTipText("<html><body>Online help page of JaCoCoverage<br>" + "https://github.com/jonathanlermitage/tikione-jacocoverage/blob/master/README.md</body></html>"); jButtonAbout.setToolTipText("<html><body>About JaCoCoverage</body></html>"); // </editor-fold> }
Example 4
Source File: MultiIconBuilder.java From ghidra with Apache License 2.0 | 4 votes |
public ImageIcon build() { ImageIcon imageIcon = ResourceManager.getImageIcon(multiIcon); imageIcon.setDescription(getDescription()); return imageIcon; }
Example 5
Source File: CustomMessages.java From Spark with Apache License 2.0 | 4 votes |
public CustomStatus() { StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); // Add Mnemonics ResourceUtils.resLabel(typeLabel, typeBox, Res.getString("label.presence")); ResourceUtils.resLabel(statusLabel, statusField, Res.getString("label.message")); ResourceUtils.resLabel(priorityLabel, priorityField, Res.getString("label.priority")); ResourceUtils.resButton(persistBox, Res.getString("button.save.for.future.use")); setLayout(new GridBagLayout()); add(typeLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(statusLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(priorityLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(typeBox, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 150, 0)); add(statusField, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); add(priorityField, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); add(persistBox, new GridBagConstraints(0, 3, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); persistBox.setSelected(true); typeBox.setRenderer(new ListIconRenderer()); // Add Types Iterator<StatusItem> statusIterator = statusBar.getStatusList().iterator(); while (statusIterator.hasNext()) { final StatusItem statusItem = statusIterator.next(); if (!PresenceManager.isOnPhone(statusItem.getPresence())) { ImageIcon icon = (ImageIcon)statusItem.getIcon(); ImageIcon newIcon = new ImageIcon(icon.getImage()); newIcon.setDescription(statusItem.getText()); typeBox.addItem(newIcon); } } priorityField.setText("1"); statusField.setText(Res.getString("status.online")); }
Example 6
Source File: GroupChatParticipantList.java From Spark with Apache License 2.0 | 4 votes |
protected ImageIcon getImageIcon(EntityFullJid participantJID) { Resourcepart displayName = participantJID.getResourcepart(); ImageIcon icon = SparkRes.getImageIcon(SparkRes.GREEN_BALL); icon.setDescription(displayName.toString()); return icon; }