示例#1
0
  @Override
  public void setForegroundAt(int index, Color foreground) {
    super.setForegroundAt(index, foreground);

    final Component comp = getTabComponentAt(index);
    if (comp instanceof TabComponent) ((TabComponent) comp).setForegroundAll(foreground);
  }
 public void propertyChange(PropertyChangeEvent e) {
   if (e.getSource() instanceof PanelThreadMonitor) {
     if (e.getPropertyName().equals("Status")) {
       PanelThreadMonitor mntTmp = (PanelThreadMonitor) e.getSource();
       int iMonitorIndex = pnlThread.indexOfComponent(mntTmp);
       if (iMonitorIndex >= 0) {
         if (e.getNewValue().equals("Started")) {
           if (!pnlThread.getBackgroundAt(iMonitorIndex).equals(COLOR_STARTED)) {
             pnlThread.setBackgroundAt(iMonitorIndex, COLOR_STARTED);
             pnlThread.setForegroundAt(iMonitorIndex, COLOR_STARTED_FG);
           }
         } else if (e.getNewValue().equals("Stopped")) {
           if (!pnlThread.getBackgroundAt(iMonitorIndex).equals(SystemColor.controlShadow)) {
             pnlThread.setBackgroundAt(iMonitorIndex, UIManager.getColor("TabbedPane.background"));
             pnlThread.setForegroundAt(iMonitorIndex, SystemColor.textText);
           }
         }
       }
     }
   }
 }