Refactor student's broken Swing app