Example #1
0
  /** Creates an instance of <tt>SkinManagerPanel</tt>. */
  public SkinManagerPanel() {
    super(new BorderLayout());

    JPanel selectorPanel = new TransparentPanel();
    selectorPanel.setLayout(new BoxLayout(selectorPanel, BoxLayout.Y_AXIS));

    skinSelector.setAlignmentX(Component.CENTER_ALIGNMENT);
    skinSelector.addItemListener(new EnableDisableListener());
    selectorPanel.add(skinSelector);

    rmButton.setAlignmentX(Component.CENTER_ALIGNMENT);
    rmButton.addActionListener(new RemoveListener());
    selectorPanel.add(rmButton);

    enableDisableButton();

    add(selectorPanel, BorderLayout.NORTH);
  }
Example #2
0
  /** Enables(if a skin <tt>Bundle</tt> is selected) or disables the remove button. */
  private void enableDisableButton() {
    Object tmp = skinSelector.getSelectedItem();

    if (tmp != null) {
      if (tmp instanceof Bundle) {
        rmButton.setEnabled(true);

        return;
      }
    }
    rmButton.setEnabled(false);
  }