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(); }
public void setBackgroundAll(Color background) { externButton.setBackground(background); label.setBackground(background); }
public void setForegroundAll(Color foreground) { externButton.setForeground(foreground); label.setForeground(foreground); }