static void clearMenuBar(final JMenuBar menuBar) { if (menuBar != null) swing { menuBar.removeAll(); } }