import javax.swing.*; import java.awt.*; public class flow extends JFrame { private JButton b1, b2, b3; private JLabel l1; private JTextField tf1; public flow() { Container pane = getContentPane(); pane.setLayout(new FlowLayout()); b1 = new JButton("Button 1"); b2 = new JButton("Button 2"); b3 = new JButton("Button 3"); l1 = new JLabel("Label 1"); tf1 = new JTextField("Text Field 1 - 30 Columns", 30); pane.add(l1); pane.add(tf1); pane.add(b1); pane.add(b2); pane.add(b3); setTitle("FlowLayout"); setSize(400,200); setDefaultCloseOperation(EXIT_ON_CLOSE); setVisible(true); } public static void main(String[] args) { flow win = new flow(); } }