private void reenablePrintUI() {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                // enable print UI controls.
                if (printMenuItem != null) {
                    printMenuItem.setEnabled(true);
                }
                if (printButton != null) {
                    printButton.setEnabled(true);
                }
            }
        });
    }