Java Window repaintMnemonicsInWindow(Window w)

Here you can find the source of repaintMnemonicsInWindow(Window w)

Description

repaint Mnemonics In Window

License

Open Source License

Declaration

static void repaintMnemonicsInWindow(Window w) 

Method Source Code

//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);
            }
        }
    }
}

Related

  1. isResizable(Window window)
  2. modifyDimensions(Window window)
  3. openWindow(final JPanel panel)
  4. putWindowNormalBounds(Window window, Rectangle bounds)
  5. removeWindow(Window w)
  6. setWindowAlpha(Window w, int value)
  7. setWindowOpacity(Window window, float opacity)
  8. show(final Container container, final boolean visible, Window appearOnLeftSide)
  9. show(JWindow window)