fix bug when generating swing gui