Example #1
0
 public void selectFirstTabWithConflicts() {
   for (int i = 0; i < tabbedPane.getTabCount(); i++) {
     if (tabbedPane.isEnabledAt(i) && mergeIncomplete.equals(tabbedPane.getIconAt(i))) {
       tabbedPane.setSelectedIndex(i);
       break;
     }
   }
 }
Example #2
0
 private static int getMaxTabHeight(JTabbedPane tp) {
   int fontHeight = tp.getFontMetrics(tp.getFont()).getHeight();
   int height = fontHeight;
   boolean tallerIcons = false;
   for (int counter = tp.getTabCount() - 1; counter >= 0; counter--) {
     Icon icon = tp.getIconAt(counter);
     if (icon != null) {
       int iconHeight = icon.getIconHeight();
       height = Math.max(height, iconHeight);
       if (iconHeight > fontHeight) {
         tallerIcons = true;
       }
     }
   }
   Insets tabInsets = UIManager.getInsets("TabbedPane.tabInsets");
   height += 2;
   if (!isMetal() || !tallerIcons) {
     height += tabInsets.top + tabInsets.bottom;
   }
   return height;
 }