xref: /AOO41X/main/toolkit/test/accessibility/EventLogger.java (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir import javax.swing.JFrame;
2*cdf0e10cSrcweir import javax.swing.JScrollPane;
3*cdf0e10cSrcweir 
4*cdf0e10cSrcweir class EventLogger
5*cdf0e10cSrcweir {
6*cdf0e10cSrcweir     public static synchronized EventLogger Instance ()
7*cdf0e10cSrcweir     {
8*cdf0e10cSrcweir         if (maInstance == null)
9*cdf0e10cSrcweir             maInstance = new EventLogger();
10*cdf0e10cSrcweir         return maInstance;
11*cdf0e10cSrcweir     }
12*cdf0e10cSrcweir 
13*cdf0e10cSrcweir     private EventLogger ()
14*cdf0e10cSrcweir     {
15*cdf0e10cSrcweir         try
16*cdf0e10cSrcweir         {
17*cdf0e10cSrcweir             maFrame = new JFrame ();
18*cdf0e10cSrcweir             maLogger = new TextLogger ();
19*cdf0e10cSrcweir             maFrame.setContentPane (new JScrollPane (maLogger));
20*cdf0e10cSrcweir 
21*cdf0e10cSrcweir             maFrame.setSize (400,300);
22*cdf0e10cSrcweir             maFrame.setVisible (true);
23*cdf0e10cSrcweir         }
24*cdf0e10cSrcweir         catch (Exception e)
25*cdf0e10cSrcweir         {}
26*cdf0e10cSrcweir     }
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir     private static EventLogger maInstance = null;
29*cdf0e10cSrcweir     private JFrame maFrame;
30*cdf0e10cSrcweir     private TextLogger maLogger;
31*cdf0e10cSrcweir }
32