标签:win visible for com i++ pac image str swing
实验源码:
package Orange;
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
public class Jiugongge {
public static void main(String[] args) {
JFrame frame = new JFrame("Welcome to Jiugongge");
frame.setLayout(new FlowLayout(FlowLayout.CENTER,3,3));
JButton but = null;
for(int i=1;i<10;i++) {
but = new JButton("按钮-"+i);
frame.add(but);
}
frame.setSize(280,123);
frame.setVisible(true);
}
}
运行结果:
标签:win visible for com i++ pac image str swing
原文地址:https://www.cnblogs.com/chixue/p/11816409.html