01: package org.jatha.display;
02:
03: import java.awt.*;
04: import javax.swing.*;
05:
06: /**
07: * This is a generic dialog that tells people that some part of the software is not yet working.
08: */
09: public class UnderConstruction extends JFrame {
10: private JTextArea jTextArea1 = new JTextArea();
11: private JTextPane jTextPane1 = new JTextPane();
12:
13: public UnderConstruction(String name, String description) {
14: try {
15: jbInit(name, description);
16: } catch (Exception e) {
17: e.printStackTrace();
18: }
19: }
20:
21: private void jbInit(String title, String message) throws Exception {
22:
23: jTextArea1.setLineWrap(true);
24: jTextArea1.setWrapStyleWord(true);
25: jTextPane1.setBackground(SystemColor.text);
26: jTextPane1.setFont(new java.awt.Font("Serif", 1, 25));
27: jTextPane1.setForeground(Color.blue);
28: jTextPane1.setText("Under Construction");
29: jTextArea1.setText(message);
30: this .getContentPane().add(jTextPane1, BorderLayout.NORTH);
31: this .getContentPane().add(jTextArea1, BorderLayout.CENTER);
32: this .getContentPane().add(jTextPane1, BorderLayout.NORTH);
33: this .getContentPane().add(jTextArea1, BorderLayout.CENTER);
34: this .setSize(new Dimension(675, 600));
35: this .setTitle(title);
36: this .pack();
37: Dimension screenSize = Toolkit.getDefaultToolkit()
38: .getScreenSize();
39: Dimension frameSize = this .getSize();
40: if (frameSize.height > screenSize.height) {
41: frameSize.height = screenSize.height;
42: }
43: if (frameSize.width > screenSize.width) {
44: frameSize.width = screenSize.width;
45: }
46: this .setLocation((screenSize.width - frameSize.width) / 2,
47: (screenSize.height - frameSize.height) / 2);
48: this .setVisible(true);
49: }
50:
51: }
|