1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| public static void main(String[] args) throws IOException {
157 JFrame frame = new JFrame("b23:production 2006 GNU/GPL - Image Multi-converter");
158 Container content = frame.getContentPane();
159 final ImageMultiConverter applet = new ImageMultiConverter(); applet.setOwner(frame);
160 JButton launch = new JButton("Launch applet...");
161 launch.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) {
162 JFrame frame = new JFrame("applet");
163 frame.getContentPane().add(applet);
164 frame.setSize(500,500);
165 applet.init();
166 frame.setVisible(true);
167 }});
168 content.setLayout(new BorderLayout());
169 URL url = applet.getClass().getResource("logo.png");
170 System.out.println(url);
171 content.add(makeDisplay((Image)ImageIO.read(url), null), BorderLayout.NORTH);
172 content.add(launch, BorderLayout.WEST);
173 content.add(new JLabel("� b23:production 2006 GNU/GPL http://b23prodtm.webhop.info"), BorderLayout.SOUTH);
174 frame.pack();
175 frame.setVisible(true);
176 }
177 |