1. © 2012 Pearson Education, Inc. All rights reserved. Chapter 7:A First Look at GUI Applications Starting Out with Java:From Control Structures through Data StructuresSecond…