展开全部
用Java创建按钮组32313133353236313431303231363533e59b9ee7ad9431333332643966的程序如下:import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
public class A extends JFrame implements ActionListener{
JButton[] b=new JButton[10];
A(){
setLayout(new GridLayout(3,4,5,5));
for(int i=0;i<10;i++){
b[i]=new JButton(String.valueOf(i));
b[i].addActionListener(this);
add(b[i]);
}
setSize(300,300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args) {
new A();
}
public void actionPerformed(ActionEvent ae) {
}
}