KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > log4j > lf5 > viewer > LogFactor5ErrorDialog


1 /*
2  * Copyright 1999-2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.log4j.lf5.viewer;
17
18 import javax.swing.*;
19 import java.awt.*;
20 import java.awt.event.ActionEvent JavaDoc;
21 import java.awt.event.ActionListener JavaDoc;
22
23 /**
24  * LogFactor5ErrorDialog
25  *
26  * @author Richard Hurst
27  * @author Brad Marlborough
28  */

29
30 // Contributed by ThoughtWorks Inc.
31

32 public class LogFactor5ErrorDialog extends LogFactor5Dialog {
33   //--------------------------------------------------------------------------
34
// Constants:
35
//--------------------------------------------------------------------------
36

37   //--------------------------------------------------------------------------
38
// Protected Variables:
39
//--------------------------------------------------------------------------
40

41   //--------------------------------------------------------------------------
42
// Private Variables:
43
//--------------------------------------------------------------------------
44

45   //--------------------------------------------------------------------------
46
// Constructors:
47
//--------------------------------------------------------------------------
48
public LogFactor5ErrorDialog(JFrame jframe, String JavaDoc message) {
49     super(jframe, "Error", true);
50
51     JButton ok = new JButton("Ok");
52     ok.addActionListener(new ActionListener JavaDoc() {
53       public void actionPerformed(ActionEvent JavaDoc e) {
54         hide();
55       }
56     });
57
58     JPanel bottom = new JPanel();
59     bottom.setLayout(new FlowLayout());
60     bottom.add(ok);
61
62     JPanel main = new JPanel();
63     main.setLayout(new GridBagLayout());
64     wrapStringOnPanel(message, main);
65
66     getContentPane().add(main, BorderLayout.CENTER);
67     getContentPane().add(bottom, BorderLayout.SOUTH);
68     show();
69
70   }
71   //--------------------------------------------------------------------------
72
// Public Methods:
73
//--------------------------------------------------------------------------
74

75   //--------------------------------------------------------------------------
76
// Protected Methods:
77
//--------------------------------------------------------------------------
78

79   //--------------------------------------------------------------------------
80
// Private Methods:
81
//--------------------------------------------------------------------------
82

83   //--------------------------------------------------------------------------
84
// Nested Top-Level Classes or Interfaces
85
//--------------------------------------------------------------------------
86
}
Popular Tags