窗口实训
1.计算器 package Demo; import java.awt.BorderLayout; import java.awt.GridLayout; import javax.swing.; public class Calucate { JFrame f; JPanel p; JTextField t; JButton b[]=new JButton[16]; GridLayout g1; public Calucate(){ f = new JFrame ("计算器"); g1= new GridLayout(4,4); p = new JPanel(); p.setLayout(g1); t = new JTextField(); b[0] = new JButton("7"); b[1] = new JButton("8"); b[2] = new JButton("9"); b[3] = new JButton("/"); b[4] = new JButton("4"); b[5] = new JButton("5"); b[6] = new JButton("6"); b[7] = new JButton(""); b[8] = new JButton("1"); b[9] = new JButton("2"); b[10] = new JButton("3");