Here you can find the source of repaintMnemonicsInWindow(Window w)
static void repaintMnemonicsInWindow(Window w)
//package com.java2s; /*/*from www . j a va 2s.com*/ * %W% %E% * * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ import java.awt.*; import javax.swing.*; public class Main { static void repaintMnemonicsInWindow(Window w) { if (w == null || !w.isShowing()) { return; } Window[] ownedWindows = w.getOwnedWindows(); for (int i = 0; i < ownedWindows.length; i++) { repaintMnemonicsInWindow(ownedWindows[i]); } repaintMnemonicsInContainer(w); } static void repaintMnemonicsInContainer(Container cont) { Component c; for (int i = 0; i < cont.getComponentCount(); i++) { c = cont.getComponent(i); if (c == null || !c.isVisible()) { continue; } if (c instanceof AbstractButton && ((AbstractButton) c).getMnemonic() != '\0') { c.repaint(); continue; } else if (c instanceof JLabel && ((JLabel) c).getDisplayedMnemonic() != '\0') { c.repaint(); continue; } if (c instanceof Container) { repaintMnemonicsInContainer((Container) c); } } } }