|| menuItem.getModel().isArmed()
|| (mod != null && mod.isArmed())
  protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect,                           String text)  {    Font f = menuItem.getFont();    g.setFont(f);    FontMetrics fm = g.getFontMetrics(f);    if (text != null && !text.equals(""))      {        if (menuItem.isEnabled())          {            // Menu item is considered to be highlighted when it is selected.            // But not if it's a JCheckBoxMenuItem            if ((menuItem.isSelected() && checkIcon == null)                || menuItem.getModel().isArmed()                && (menuItem.getParent() instanceof MenuElement))              g.setColor(selectionForeground);            else              g.setColor(menuItem.getForeground());          }        else          // FIXME: should fix this to use 'disabledForeground', but its          // default value in BasicLookAndFeel is null.          // FIXME: should there be different foreground colours for selected          // or deselected, when disabled?          g.setColor(Color.gray);        int mnemonicIndex = menuItem.getDisplayedMnemonicIndex();        if (mnemonicIndex != -1)          BasicGraphicsUtils.drawStringUnderlineCharAt(g, text, mnemonicIndex,                                                       textRect.x,                                                       textRect.y                                                           + fm.getAscent());        else          BasicGraphicsUtils.drawString(g, text, 0, textRect.x,                                        textRect.y + fm.getAscent());      }  }