import java.awt.*; 
import javax.swing.*; 

public class VisaFlowLayout extends JFrame { 

    JButton[] knappar = new JButton[10]; 

    public VisaFlowLayout() { 
	getContentPane().setBackground(Color.yellow);
	setTitle("Visa FlowLayout"); 
	getContentPane().setLayout( new FlowLayout(FlowLayout.LEFT,10,20)); 
	for (int i = 0; i < knappar.length; i = i + 1) { 
	    knappar[i] = new JButton("Knapp " + (i+1)); 
	    knappar[i].setForeground(Color.blue);
	    knappar[i].setBackground(Color.pink);
	    getContentPane().add(knappar[i]); 
	} 
    } 
    public static void main(String[] args) { 
	JFrame f = new VisaFlowLayout(); 
	f.setSize(400,200);
	f.setVisible(true); 
	f.setDefaultCloseOperation(EXIT_ON_CLOSE);
    } 
} 
