View Javadoc
1 package net.mlw.fball.gui;
2
3 import java.awt.BorderLayout;
4 import java.awt.Color;
5 import java.io.IOException;
6
7 import javax.swing.JFrame;
8 import javax.swing.JSplitPane;
9 import javax.swing.JTextField;
10
11 import net.mlw.fball.event.Event;
12 import net.mlw.fball.event.EventListener;
13 import net.mlw.fball.gui.events.ErrorEvent;
14
15 /***
16 *
17 * @author Matthew L. Wilson
18 * @version $Revision: 1.5 $ $Date: 2004/07/13 16:33:56 $
19 */
20 public class Launcher
21 {
22 public static void main(String[] args)
23 {
24 JFrame frame = new JFrame();
25
26 try
27 {
28 AppContext.init(new String[] { "applicationContext.xml", "swingApplicationContext.xml", "yahooContext.xml" });
29 }
30 catch (Throwable e)
31 {
32 e.printStackTrace();
33 }
34
35 final JTextField status = new JTextField();
36 status.setEditable(false);
37
38 frame.setTitle(AppContext.getMessage("title"));
39 frame.addWindowListener(new java.awt.event.WindowAdapter()
40 {
41 public void windowClosing(java.awt.event.WindowEvent evt)
42 {
43 AppContext.close();
44 System.exit(0);
45 }
46 });
47
48 frame.setJMenuBar(new DefaultMenuBar());
49 frame.setSize(500, 400);
50 JSplitPane jSplitPane = new JSplitPane();
51 jSplitPane.setLeftComponent(new ExecutionTreeMenu());
52 jSplitPane.setRightComponent(new LoaderDetail());
53
54 frame.getContentPane().add(BorderLayout.CENTER, jSplitPane);
55 frame.getContentPane().add(BorderLayout.SOUTH, status);
56
57 frame.setVisible(true);
58
59 AppContext.getEventListenerGroup().addListener(ErrorEvent.class, new EventListener()
60 {
61 public void onEvent(Event event)
62 {
63 status.setText(event.toString());
64 status.setForeground(Color.RED);
65 }
66 });
67
68 }
69 }
This page was automatically generated by Maven