01: //The contents of this file are subject to the Mozilla Public License Version 1.1
02: //(the "License"); you may not use this file except in compliance with the
03: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
04: //
05: //Software distributed under the License is distributed on an "AS IS" basis,
06: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
07: //for the specific language governing rights and
08: //limitations under the License.
09: //
10: //The Original Code is "The Columba Project"
11: //
12: //The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
13: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
14: //
15: //All Rights Reserved.
16: package org.columba.core.gui.logdisplay;
17:
18: import java.awt.BorderLayout;
19: import java.awt.Container;
20:
21: import javax.swing.JFrame;
22:
23: import org.frapuccino.awt.WindowsUtil;
24:
25: /**
26: * @author redsolo
27: */
28: public class LogDisplayFrame extends JFrame {
29:
30: private static LogDisplayFrame frameInstance;
31:
32: /**
33: * @param title
34: * @throws java.awt.HeadlessException
35: */
36: public LogDisplayFrame() {
37: super ("Log display");
38: Container container = getContentPane();
39: container.setLayout(new BorderLayout());
40: container.add(new LogPanel(), BorderLayout.CENTER);
41: pack();
42: setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
43: }
44:
45: /**
46: * Shows the Log display frame.
47: * Creates only one instance of this frame.
48: */
49: public static void showFrame() {
50: if (frameInstance == null) {
51: frameInstance = new LogDisplayFrame();
52: WindowsUtil.centerInScreen(frameInstance);
53: }
54: frameInstance.setVisible(true);
55: }
56: }
|