using swing utilities instead of thread