Use Timer instead of invokeLater.