package second; import java.awt.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; public class Layout { private Frame f; private Button b1,b2,b3,b4,b5,b6,b7,b8,b9,b10;//声明10个button //构造函数,实例化button 1 - 10 Layout(){ b1 = new B…