List of usage examples for javax.swing JMenuBar setForeground
@BeanProperty(preferred = true, visualUpdate = true, description = "The foreground color of the component.") public void setForeground(Color fg)
From source file:Main.java
/** * change background and foreground color for menu bar * @param aMenuBar menu bar// w w w. ja va 2s . c o m * @param aBackgroundColor background color * @param aForegroundColor foreground color */ public final static void ChangeColor(JMenuBar aMenuBar, Color aBackgroundColor, Color aForegroundColor) { if (aBackgroundColor != null) { aMenuBar.setBackground(aBackgroundColor); } if (aForegroundColor != null) { aMenuBar.setForeground(aForegroundColor); } JMenu menu = null; for (int count = 0; count < aMenuBar.getMenuCount(); count++) { menu = aMenuBar.getMenu(count); ChangeColor(menu, aBackgroundColor, aForegroundColor); } }