/** FlowPanel.java -- "flow" is the default layout for a container. Try to * align components left-to-right in a row, and go on underneath to a new * row if we run out of room. When you resize the frame, you'll notice * a change dynamically. */ import java.awt.*; import javax.swing.*; public class FlowPanel extends JPanel { public FlowPanel() { setLayout(new FlowLayout()); setBackground(Color.green); JLabel caption = new JLabel("feed the birds"); JLabel picture = new JLabel(new ImageIcon("lagoon.jpg")); JButton b1 = new JButton("Button 1"); JButton b2 = new JButton("Button 2"); JButton b3 = new JButton("Button 3"); add(caption); add(picture); add(b1); add(b2); add(b3); } }