import java.awt.*; public class JanelaFlow extends Frame { public JanelaFlow() { setTitle("FlowLayout"); setSize(240,100); setLayout(new FlowLayout()); } public void addButton(int count) { for(int i=1; i <= count; ++i) add(new Button("B"+i)); } public static void main(String[] args) { JanelaFlow j = new JanelaFlow(); int qtde = 10; try { if (args.length > 0) qtde = Integer.parseInt(args[0]); } catch (Exception e) { } j.addButton(qtde); j.validate(); j.setVisible(true); } }