LookAndFeel.installBorder(menuItem, "MenuItem.border"); LookAndFeel.installColorsAndFont(menuItem, "MenuItem.background", "MenuItem.foreground", "MenuItem.font"); menuItem.setMargin(UIManager.getInsets("MenuItem.margin")); acceleratorFont = UIManager.getFont("MenuItem.acceleratorFont"); acceleratorForeground = UIManager.getColor("MenuItem.acceleratorForeground"); acceleratorSelectionForeground = UIManager.getColor("MenuItem.acceleratorSelectionForeground"); selectionBackground = UIManager.getColor("MenuItem.selectionBackground"); selectionForeground = UIManager.getColor("MenuItem.selectionForeground"); acceleratorDelimiter = UIManager.getString("MenuItem.acceleratorDelimiter");
String prefix = getPropertyPrefix(); LookAndFeel.installBorder(menuItem, prefix + ".border"); LookAndFeel.installColorsAndFont(menuItem, prefix + ".background", prefix + ".foreground", prefix + ".font"); menuItem.setMargin(UIManager.getInsets(prefix + ".margin")); acceleratorFont = UIManager.getFont(prefix + ".acceleratorFont"); acceleratorForeground = UIManager.getColor(prefix + ".acceleratorForeground"); acceleratorSelectionForeground = UIManager.getColor(prefix + ".acceleratorSelectionForeground"); selectionBackground = UIManager.getColor(prefix + ".selectionBackground"); selectionForeground = UIManager.getColor(prefix + ".selectionForeground"); acceleratorDelimiter = UIManager.getString(prefix + ".acceleratorDelimiter"); checkIcon = UIManager.getIcon(prefix + ".checkIcon");
  protected void installDefaults()  {    LookAndFeel.installBorder(menuItem, "MenuItem.border");    LookAndFeel.installColorsAndFont(menuItem, "MenuItem.background",                                     "MenuItem.foreground", "MenuItem.font");    menuItem.setMargin(UIManager.getInsets("MenuItem.margin"));    acceleratorFont = UIManager.getFont("MenuItem.acceleratorFont");    acceleratorForeground = UIManager.getColor("MenuItem.acceleratorForeground");    acceleratorSelectionForeground = UIManager.getColor("MenuItem.acceleratorSelectionForeground");    selectionBackground = UIManager.getColor("MenuItem.selectionBackground");    selectionForeground = UIManager.getColor("MenuItem.selectionForeground");    acceleratorDelimiter = UIManager.getString("MenuItem.acceleratorDelimiter");    menuItem.setHorizontalTextPosition(SwingConstants.TRAILING);    menuItem.setHorizontalAlignment(SwingConstants.LEADING);    menuItem.setOpaque(true);  }