SwingUtil adds a click event to focus the frame, but the frame isn't fully built when the icon is created. Click after the icon was made and before the frame was built caused a crash. Moved icon creation to after the frame is built, should resolve the problem.