import java.awt.*;
import javax.swing.*;

public class FlowTest3 extends JFrame {
    String[] strings = {"Java", "is", "an", "excellent", "programming", "langauge"}; 
    JButton[] buttons = new JButton[strings.length];
    Container contentPane;
    public FlowTest3() {
        super("Right");
	contentPane = getContentPane();
	// I use right alignment
	contentPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
	for(int i = 0; i < strings.length; i++) {
	    buttons[i] = new JButton(strings[i]);
	    contentPane.add(buttons[i]);
	}
	contentPane.add(new JButton("and"), 4); // add after button "excellent"
	contentPane.add(new JButton("easy"), 5); // add after button "and"
    }
    

    
   public static void main(String[] args) {
        FlowTest3 f = new FlowTest3();
	f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	f.setSize(200,180);
	f.setVisible(true);
    }
}
