Java Swing Menu setFontsToMenu(MenuElement menuElement, Font font)

Here you can find the source of setFontsToMenu(MenuElement menuElement, Font font)

Description

set Fonts To Menu

License

Open Source License

Declaration

static public void setFontsToMenu(MenuElement menuElement, Font font) 

Method Source Code


//package com.java2s;
import java.awt.Font;

import javax.swing.MenuElement;

public class Main {
    static public void setFontsToMenu(MenuElement menuElement, Font font) {
        MenuElement[] subElements = menuElement.getSubElements();

        menuElement.getComponent().setFont(font);
        menuElement.getComponent().invalidate();
        if (subElements == null)
            return;

        for (int i = 0; i < subElements.length; i++)
            setFontsToMenu(subElements[i], font);
    }/*from w  w w .  j  a  va 2 s .  co  m*/
}

Related

  1. makeMenuBar(List menus)
  2. makeMenubarNice()
  3. menuDigit(int digit)
  4. menuKeystroke(int virtualKey)
  5. removeMenuMnemonics(MenuElement[] elements)
  6. setMenuFont(Object item, Font theFont)
  7. setMenuText(AbstractButton item, String text, boolean useMnemonic)
  8. setMenuUp(boolean s, JComponent c)
  9. setViewportMenu(JComponent c)