Exemplo n.º 1
0
    /**
     * Return a component that has been configured to display the specified value.
     *
     * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, Object,
     *     int, boolean, boolean)
     */
    public Component getListCellRendererComponent(
        JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
      final String key = (String) value;
      final Icon icon = IconSource.getIcon(key);

      final Color back = isSelected ? list.getSelectionBackground() : list.getBackground();
      setBackground(back);
      iconLabel.setBackground(back);

      iconLabel.setIcon(icon);

      return this;
    }
Exemplo n.º 2
0
 /**
  * Builds and answers the preference's header.
  *
  * @return JComponent header of dialog box
  */
 protected JComponent buildHeader() {
   return new HeaderPanelExt(
       Strings.message("blogstarz.settings.dialog.title"),
       Strings.message("blogstarz.settings.dialog.header"),
       IconSource.getIcon(ResourceID.ICON_PREFERENCES));
 }