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

public class JLabelExample extends JFrame {

	public JLabelExample() {
		super("JLabel example");
		Container cp = getContentPane();

		ImageIcon b_icon = new ImageIcon("back.gif");
		ImageIcon f_icon = new ImageIcon("forward.gif");
		JLabel b = new JLabel(b_icon, JLabel.CENTER);
		JLabel l1 = new JLabel("101");
		JLabel l2 = new JLabel("102");
		JLabel l3 = new JLabel("103");
		JLabel f = new JLabel(f_icon, JLabel.CENTER);

		cp.setLayout(new BoxLayout(cp, BoxLayout.X_AXIS));
		cp.add(Box.createRigidArea(new Dimension(40, 50)));
		cp.add(b);
		cp.add(Box.createHorizontalStrut(10));
		cp.add(l1);
		cp.add(Box.createHorizontalStrut(10));
		cp.add(l2);
		cp.add(Box.createHorizontalStrut(10));
		cp.add(l3);
		cp.add(Box.createHorizontalStrut(10));
		cp.add(f);
		cp.add(Box.createRigidArea(new Dimension(40, 50)));
	}

	public static void main(String args[]) {
		JLabelExample b = new JLabelExample();
		b.pack();
		b.setVisible(true);
	}
}
