Program: 3916
Project: 3916
Buggy source:
public MySelectionPanel(Action action,Action shareAction,Category category,LibraryPanel panel){
  super(new MigLayout("String_Node_Str"));
  this.libraryPanel=panel;
  GuiUtils.assignResources(this);
  setOpaque(false);
  button=new JButton(action);
  button.setContentAreaFilled(false);
  button.setBorderPainted(false);
  button.setFocusPainted(false);
  button.setBorder(BorderFactory.createEmptyBorder(2,8,2,0));
  button.setHorizontalAlignment(SwingConstants.LEFT);
  button.setOpaque(false);
  button.getAction().addPropertyChangeListener(new PropertyChangeListener(){
    @Override public void propertyChange(    PropertyChangeEvent evt){
      if (evt.getPropertyName().equals(Action.SELECTED_KEY)) {
        if (Boolean.TRUE.equals(evt.getNewValue())) {
          setOpaque(true);
          setBackground(selectedBackground);
          button.setForeground(selectedTextColor);
          if (shareButton != null) {
            shareButton.setVisible(true);
          }
        }
 else {
          setOpaque(false);
          button.setForeground(textColor);
          if (shareButton != null) {
            shareButton.setVisible(false);
          }
        }
        repaint();
      }
 else       if (evt.getPropertyName().equals("String_Node_Str")) {
        boolean value=(Boolean)evt.getNewValue();
        setVisible(value);
        if (value == false && button.getAction().getValue(Action.SELECTED_KEY) != null && button.getAction().getValue(Action.SELECTED_KEY).equals(Boolean.TRUE)) {
          libraryPanel.selectFirst();
        }
      }
    }
  }
);
  add(button,"String_Node_Str");
  if (category == Category.AUDIO || category == Category.VIDEO || category == Category.IMAGE) {
    shareButton=new HyperlinkButton(null,shareAction);
    shareButton.setContentAreaFilled(false);
    shareButton.setBorderPainted(false);
    shareButton.setFocusPainted(false);
    shareButton.setBorder(BorderFactory.createEmptyBorder(2,0,2,4));
    shareButton.setOpaque(false);
    shareButton.setVisible(false);
    FontUtils.underline(shareButton);
    shareButton.setFont(shareButtonFont);
    shareButton.setForeground(shareForegroundColor);
    shareButton.setRolloverForeground(shareMouseOverColor);
    add(shareButton,"String_Node_Str");
  }
}

Fixed version (ground truth):
public MySelectionPanel(Action action,Action shareAction,Category category,LibraryPanel panel){
  super(new MigLayout("String_Node_Str"));
  this.libraryPanel=panel;
  GuiUtils.assignResources(this);
  setOpaque(false);
  button=new JButton(action);
  button.setContentAreaFilled(false);
  button.setBorderPainted(false);
  button.setFocusPainted(false);
  button.setBorder(BorderFactory.createEmptyBorder(2,8,2,0));
  button.setHorizontalAlignment(SwingConstants.LEFT);
  button.setOpaque(false);
  button.getAction().addPropertyChangeListener(new PropertyChangeListener(){
    @Override public void propertyChange(    PropertyChangeEvent evt){
      if (evt.getPropertyName().equals(Action.SELECTED_KEY)) {
        if (Boolean.TRUE.equals(evt.getNewValue())) {
          setOpaque(true);
          setBackground(selectedBackground);
          button.setForeground(selectedTextColor);
          if (shareButton != null) {
            shareButton.setVisible(true);
          }
        }
 else {
          setOpaque(false);
          button.setForeground(textColor);
          if (shareButton != null) {
            shareButton.setVisible(false);
          }
        }
        repaint();
      }
 else       if (evt.getPropertyName().equals("String_Node_Str")) {
        boolean value=(Boolean)evt.getNewValue();
        setVisible(value);
        if (value == false && button.getAction().getValue(Action.SELECTED_KEY) != null && button.getAction().getValue(Action.SELECTED_KEY).equals(Boolean.TRUE)) {
          libraryPanel.selectFirst();
        }
      }
    }
  }
);
  add(button,"String_Node_Str");
  if (category == Category.AUDIO || category == Category.VIDEO || category == Category.IMAGE) {
    shareButton=new HyperlinkButton(shareAction);
    shareButton.setBorder(BorderFactory.createEmptyBorder(2,0,2,4));
    shareButton.setVisible(false);
    shareButton.setFont(shareButtonFont);
    shareButton.setForeground(shareForegroundColor);
    shareButton.setRolloverForeground(shareMouseOverColor);
    add(shareButton,"String_Node_Str");
  }
}