下面列出了javax.swing.ImageIcon#setDescription ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* 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);
}
}
/**
*
*/
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);
}
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>
}
public ImageIcon build() {
ImageIcon imageIcon = ResourceManager.getImageIcon(multiIcon);
imageIcon.setDescription(getDescription());
return imageIcon;
}
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"));
}
protected ImageIcon getImageIcon(EntityFullJid participantJID) {
Resourcepart displayName = participantJID.getResourcepart();
ImageIcon icon = SparkRes.getImageIcon(SparkRes.GREEN_BALL);
icon.setDescription(displayName.toString());
return icon;
}