Esempio n. 1
0
    public TabComponent(String title, Icon icon, ExternalizablePanel panel, String tip, int index) {
      super();

      setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));
      setBorder(BorderFactory.createEmptyBorder());
      setOpaque(false);

      this.index = index;
      this.tip = tip;
      extPanel = panel;

      label = new JLabel(title + " ", icon, SwingConstants.CENTER);
      label.setOpaque(false);

      externButton = new IcyButton(ResourceUtil.ICON_EXPAND, 16);
      externButton.setFlat(true);
      externButton.setOpaque(false);
      externButton.setContentAreaFilled(false);
      externButton.setToolTipText("Externalize panel");
      externButton.addActionListener(
          new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
              // externalize panel
              extPanel.externalize();
            }
          });

      add(label);
      add(externButton);

      validate();
    }
Esempio n. 2
0
 public void setBackgroundAll(Color background) {
   externButton.setBackground(background);
   label.setBackground(background);
 }
Esempio n. 3
0
 public void setForegroundAll(Color foreground) {
   externButton.setForeground(foreground);
   label.setForeground(foreground);
 }