mv gui related code to main.java