Here you can find the source of applyContextMenuFontRecurse(MenuElement item, Font font)
public static void applyContextMenuFontRecurse(MenuElement item, Font font)
//package com.java2s; /*//from ww w .j a v a 2s. c o m * Misc.cs * Copyright ? 2008-2011 kbinani * * This file is part of org.kbinani.apputil. * * org.kbinani.apputil is free software; you can redistribute it and/or * modify it under the terms of the BSD License. * * org.kbinani.apputil is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ import java.awt.*; import javax.swing.*; public class Main { public static boolean isApplyFontRecurseEnabled = true; public static void applyContextMenuFontRecurse(MenuElement item, Font font) { if (!isApplyFontRecurseEnabled) { return; } applyToolStripFontRecurse(item, font); } public static void applyToolStripFontRecurse(MenuElement item, Font font) { if (!isApplyFontRecurseEnabled) { return; } if (item instanceof Component) { ((Component) item).setFont(font); } for (MenuElement element : item.getSubElements()) { applyToolStripFontRecurse(element, font); } } }