if (menuItem.getModel().isArmed() && (menuItem.getParent() instanceof MenuElement || menuItem.getModel().isPressed()))
if ((menuItem.isSelected() && checkIcon == null) || menuItem.getModel().isArmed() && (menuItem.getParent() instanceof MenuElement))
  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.               It is considered to be selected if menu item is inside some menu               and is armed or if it is both armed and pressed */            if (menuItem.getModel().isArmed()                && (menuItem.getParent() instanceof MenuElement                    || menuItem.getModel().isPressed()))              g.setColor(selectionForeground);            else	  g.setColor(menuItem.getForeground());          }	else	  // FIXME: should fix this to use 'disabledForeground', but its	  // default value in BasicLookAndFeel is null.	  	  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());  }  }