/** Updates the UI of the passed in window and all its children. */ private static void updateWindowUI(Window window) { SwingUtilities.updateComponentTreeUI(window); Window ownedWins[] = window.getOwnedWindows(); for (int i = 0; i < ownedWins.length; i++) { updateWindowUI(ownedWins[i]); } }
/** * Requests that all components in the GUI hierarchy be updated to reflect dynamic changes in this * look&feel. This update occurs by uninstalling and re-installing the UI objects. Requests are * batched and collapsed into a single update pass because often many desktop properties will * change at once. */ protected void updateUI() { if (!isUpdatePending()) { setUpdatePending(true); Runnable uiUpdater = new Runnable() { public void run() { updateAllUIs(); setUpdatePending(false); } }; SwingUtilities.invokeLater(uiUpdater); } }