01: import java.awt.*;
02: import javax.swing.*;
03: 
04: /**
05:    This program demonstrates the use of the image proxy.
06:    Images are only loaded when you press on a tab.
07: */
08: public class ProxyTester
09: {
10:    public static void main(String[] args)
11:    {
12:       JTabbedPane tabbedPane = new JTabbedPane();
13:       for (String name : imageNames)
14:       {
15:          JLabel label = new JLabel(new ImageProxy(name));
16:          tabbedPane.add(name, label);
17:       }
18: 
19:       JFrame frame = new JFrame();
20:       frame.add(tabbedPane);
21: 
22:       frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
23:       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
24:       frame.setVisible(true);
25:    }
26: 
27:    private static final String[] imageNames =
28:    {
29:       "devonian.gif",
30:       "permian.gif",
31:       "jurassic1.gif",
32:       "jurassic2.gif",
33:       "cretaceous1.gif",
34:       "cretaceous2.gif",
35:       "cretaceous3.gif",
36:       "eocene1.gif",
37:       "eocene2.gif",
38:       "oligocene.gif",
39:       "miocene.gif",
40:       "pleistocene.gif"
41:    };
42: 
43:    private static final int FRAME_WIDTH = 500;
44:    private static final int FRAME_HEIGHT = 300;
45: }