1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.dbforms.devgui;
25
26
27 /***
28 * DOCUMENT ME!
29 *
30 * @author $author$
31 * @version $Revision: 1.6 $
32 */
33 public class HelpFrame extends javax.swing.JFrame {
34 private javax.swing.JButton closeBtn;
35 private javax.swing.JEditorPane jEditorPane1;
36 private javax.swing.JPanel jPanel4;
37
38
39
40 private javax.swing.JScrollPane jScrollPane1;
41
42 /***
43 * Creates new form HelpFrame
44 */
45 public HelpFrame() {
46 initComponents();
47
48 String dbFormsHomeStr = System.getProperty("DBFORMS_HOME");
49
50 if (dbFormsHomeStr != null) {
51 String fileSeparator = System.getProperties()
52 .getProperty("file.separator");
53 String helpfilename = dbFormsHomeStr + fileSeparator + "doc"
54 + fileSeparator + "devgui" + fileSeparator
55 + "devgui.html";
56
57 try {
58 jEditorPane1.setPage("file:" + helpfilename);
59 setTitle("Helpfile: " + helpfilename);
60 } catch (Exception ex) {
61 jEditorPane1.setText("Error: could not load helpfile '"
62 + helpfilename + "'\n" + ex.getMessage());
63 }
64
65 pack();
66 }
67
68 this.setSize(520, 500);
69 }
70
71
72 private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {
73 this.setVisible(false);
74 }
75
76
77
78
79 /***
80 * Exit the Application
81 *
82 * @param evt DOCUMENT ME!
83 */
84 private void exitForm(java.awt.event.WindowEvent evt) {
85 this.setVisible(false);
86 }
87
88
89 /***
90 * This method is called from within the constructor to initialize the form.
91 * WARNING: Do NOT modify this code. The content of this method is always
92 * regenerated by the Form Editor.
93 */
94 private void initComponents() {
95 jScrollPane1 = new javax.swing.JScrollPane();
96 jEditorPane1 = new javax.swing.JEditorPane();
97 jPanel4 = new javax.swing.JPanel();
98 closeBtn = new javax.swing.JButton();
99
100 setTitle("DevGui Help");
101 addWindowListener(new java.awt.event.WindowAdapter() {
102 public void windowClosing(java.awt.event.WindowEvent evt) {
103 exitForm(evt);
104 }
105 });
106
107 jScrollPane1.setMinimumSize(new java.awt.Dimension(150, 200));
108 jEditorPane1.setEditable(false);
109 jScrollPane1.setViewportView(jEditorPane1);
110
111 getContentPane()
112 .add(jScrollPane1, java.awt.BorderLayout.CENTER);
113
114 closeBtn.setToolTipText("Close help window");
115 closeBtn.setText("Close");
116 closeBtn.addActionListener(new java.awt.event.ActionListener() {
117 public void actionPerformed(java.awt.event.ActionEvent evt) {
118 closeBtnActionPerformed(evt);
119 }
120 });
121
122 jPanel4.add(closeBtn);
123
124 getContentPane()
125 .add(jPanel4, java.awt.BorderLayout.SOUTH);
126
127 pack();
128 }
129
130
131 }