2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
8 import java
.util
.ArrayList
;
9 import javax
.swing
.JOptionPane
;
15 public class MainFrame
extends javax
.swing
.JFrame
{
18 * Creates new form MainFrame
25 * This method is called from within the constructor to initialize the form.
26 * WARNING: Do NOT modify this code. The content of this method is always
27 * regenerated by the Form Editor.
29 @SuppressWarnings("unchecked")
30 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
31 private void initComponents() {
33 jMenuBar1
= new javax
.swing
.JMenuBar();
34 menuMaster
= new javax
.swing
.JMenu();
35 menuClientMaster
= new javax
.swing
.JMenuItem();
36 menuLawyerNotices
= new javax
.swing
.JMenu();
37 menuCreateNotice
= new javax
.swing
.JMenuItem();
38 menuManageNotices
= new javax
.swing
.JMenuItem();
39 jSeparator1
= new javax
.swing
.JPopupMenu
.Separator();
40 menuGenerateRaisedBills
= new javax
.swing
.JMenuItem();
41 menuNoticesReports
= new javax
.swing
.JMenu();
42 menuNoticesToBeDrafted
= new javax
.swing
.JMenuItem();
43 menuNoticesClarificationPending
= new javax
.swing
.JMenuItem();
44 menuNoticeDraftAwaitingApproval
= new javax
.swing
.JMenuItem();
45 menuNoticesSentNotYetDelivered
= new javax
.swing
.JMenuItem();
46 menuAwaitingPayment
= new javax
.swing
.JMenuItem();
47 menuSettings
= new javax
.swing
.JMenu();
48 menuDatabaseSettings
= new javax
.swing
.JMenuItem();
49 menuStationery
= new javax
.swing
.JMenuItem();
51 setDefaultCloseOperation(javax
.swing
.WindowConstants
.EXIT_ON_CLOSE
);
52 setTitle("Habeas - Law Office Manager");
53 setLocationByPlatform(true);
55 menuMaster
.setMnemonic('M');
56 menuMaster
.setText("Master");
58 menuClientMaster
.setMnemonic('c');
59 menuClientMaster
.setText("Client Master...");
60 menuClientMaster
.addActionListener(new java
.awt
.event
.ActionListener() {
61 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
62 menuClientMasterActionPerformed(evt
);
65 menuMaster
.add(menuClientMaster
);
67 jMenuBar1
.add(menuMaster
);
69 menuLawyerNotices
.setMnemonic('L');
70 menuLawyerNotices
.setText("Lawyer Notices");
72 menuCreateNotice
.setMnemonic('C');
73 menuCreateNotice
.setText("Create New...");
74 menuCreateNotice
.addActionListener(new java
.awt
.event
.ActionListener() {
75 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
76 menuCreateNoticeActionPerformed(evt
);
79 menuLawyerNotices
.add(menuCreateNotice
);
81 menuManageNotices
.setMnemonic('M');
82 menuManageNotices
.setText("Manage Notices...");
83 menuManageNotices
.addActionListener(new java
.awt
.event
.ActionListener() {
84 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
85 menuManageNoticesActionPerformed(evt
);
88 menuLawyerNotices
.add(menuManageNotices
);
89 menuLawyerNotices
.add(jSeparator1
);
91 menuGenerateRaisedBills
.setMnemonic('G');
92 menuGenerateRaisedBills
.setText("Generate Raised Bills...");
93 menuGenerateRaisedBills
.addActionListener(new java
.awt
.event
.ActionListener() {
94 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
95 menuGenerateRaisedBillsActionPerformed(evt
);
98 menuLawyerNotices
.add(menuGenerateRaisedBills
);
100 menuNoticesReports
.setMnemonic('r');
101 menuNoticesReports
.setText("Reports");
103 menuNoticesToBeDrafted
.setText("To Be Drafted...");
104 menuNoticesToBeDrafted
.addActionListener(new java
.awt
.event
.ActionListener() {
105 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
106 menuNoticesToBeDraftedActionPerformed(evt
);
109 menuNoticesReports
.add(menuNoticesToBeDrafted
);
111 menuNoticesClarificationPending
.setMnemonic('c');
112 menuNoticesClarificationPending
.setText("Clarifications pending...");
113 menuNoticesClarificationPending
.addActionListener(new java
.awt
.event
.ActionListener() {
114 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
115 menuNoticesClarificationPendingActionPerformed(evt
);
118 menuNoticesReports
.add(menuNoticesClarificationPending
);
120 menuNoticeDraftAwaitingApproval
.setMnemonic('d');
121 menuNoticeDraftAwaitingApproval
.setText("Drafts to be approved...");
122 menuNoticeDraftAwaitingApproval
.addActionListener(new java
.awt
.event
.ActionListener() {
123 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
124 menuNoticeDraftAwaitingApprovalActionPerformed(evt
);
127 menuNoticesReports
.add(menuNoticeDraftAwaitingApproval
);
129 menuNoticesSentNotYetDelivered
.setMnemonic('s');
130 menuNoticesSentNotYetDelivered
.setText("Notices sent not yet delivered...");
131 menuNoticesSentNotYetDelivered
.addActionListener(new java
.awt
.event
.ActionListener() {
132 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
133 menuNoticesSentNotYetDeliveredActionPerformed(evt
);
136 menuNoticesReports
.add(menuNoticesSentNotYetDelivered
);
138 menuAwaitingPayment
.setMnemonic('a');
139 menuAwaitingPayment
.setText("Bills awaiting payment...");
140 menuAwaitingPayment
.addActionListener(new java
.awt
.event
.ActionListener() {
141 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
142 menuAwaitingPaymentActionPerformed(evt
);
145 menuNoticesReports
.add(menuAwaitingPayment
);
147 menuLawyerNotices
.add(menuNoticesReports
);
149 jMenuBar1
.add(menuLawyerNotices
);
151 menuSettings
.setMnemonic('S');
152 menuSettings
.setText("Settings");
154 menuDatabaseSettings
.setMnemonic('D');
155 menuDatabaseSettings
.setText("Database...");
156 menuDatabaseSettings
.addActionListener(new java
.awt
.event
.ActionListener() {
157 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
158 menuDatabaseSettingsActionPerformed(evt
);
161 menuSettings
.add(menuDatabaseSettings
);
163 menuStationery
.setMnemonic('S');
164 menuStationery
.setText("Stationery Settings...");
165 menuStationery
.addActionListener(new java
.awt
.event
.ActionListener() {
166 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
167 menuStationeryActionPerformed(evt
);
170 menuSettings
.add(menuStationery
);
172 jMenuBar1
.add(menuSettings
);
174 setJMenuBar(jMenuBar1
);
176 javax
.swing
.GroupLayout layout
= new javax
.swing
.GroupLayout(getContentPane());
177 getContentPane().setLayout(layout
);
178 layout
.setHorizontalGroup(
179 layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
180 .addGap(0, 586, Short
.MAX_VALUE
)
182 layout
.setVerticalGroup(
183 layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
184 .addGap(0, 292, Short
.MAX_VALUE
)
188 }// </editor-fold>//GEN-END:initComponents
190 private void menuDatabaseSettingsActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuDatabaseSettingsActionPerformed
191 // TODO add your handling code here:
192 DatabaseSettingsDialog frm
= new DatabaseSettingsDialog (this, true);
193 frm
.setVisible(true);
194 }//GEN-LAST:event_menuDatabaseSettingsActionPerformed
196 private void menuClientMasterActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuClientMasterActionPerformed
197 // TODO add your handling code here:
198 ClientMasterDialog frm
= new ClientMasterDialog (this, true);
199 frm
.setVisible(true);
200 }//GEN-LAST:event_menuClientMasterActionPerformed
202 private void menuCreateNoticeActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuCreateNoticeActionPerformed
203 // TODO add your handling code here:
204 CreateNoticeDialog frm
= new CreateNoticeDialog(this, true);
205 frm
.setVisible(true);
206 }//GEN-LAST:event_menuCreateNoticeActionPerformed
208 private void menuManageNoticesActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuManageNoticesActionPerformed
209 // TODO add your handling code here:
210 ManageNoticesDialog frm
= new ManageNoticesDialog(this, true);
211 frm
.setVisible(true);
212 }//GEN-LAST:event_menuManageNoticesActionPerformed
214 private void menuStationeryActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuStationeryActionPerformed
215 // TODO add your handling code here:
216 StationerySettingsDialog frm
= new StationerySettingsDialog(this, true);
217 frm
.setVisible(true);
218 }//GEN-LAST:event_menuStationeryActionPerformed
220 private void menuGenerateRaisedBillsActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuGenerateRaisedBillsActionPerformed
221 // TODO add your handling code here:
222 GenerateRaisedBillsDialog frm
= new GenerateRaisedBillsDialog(this, true);
223 frm
.setVisible(true);
225 }//GEN-LAST:event_menuGenerateRaisedBillsActionPerformed
227 private void menuAwaitingPaymentActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuAwaitingPaymentActionPerformed
228 // TODO add your handling code here:
229 NoticesReportViewDialog frm
= new NoticesReportViewDialog(this, false);
230 String
[] cols
= {"Reference Number", "Description", "Bill Date", "Bill Amount", "Client"};
232 ArrayList
<Object
> data
= Utility
.getReportData(rep
, -1);
234 JOptionPane
.showMessageDialog(this, ERROR_DISPLAYING_REPORT
);
237 frm
.setupReportTable(rep
, REPORT_TITLE_BILLS_AWAITING_PAYMENT
, cols
, data
);
238 frm
.setVisible(true);
239 }//GEN-LAST:event_menuAwaitingPaymentActionPerformed
241 private void menuNoticesSentNotYetDeliveredActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuNoticesSentNotYetDeliveredActionPerformed
242 // TODO add your handling code here:
243 NoticesReportViewDialog frm
= new NoticesReportViewDialog(this, false);
244 String
[] cols
= {"Reference Number", "Description", "Sent Date", "RPAD Reference", "Client"};
246 ArrayList
<Object
> data
= Utility
.getReportData (rep
, -1);
248 JOptionPane
.showMessageDialog(this, ERROR_DISPLAYING_REPORT
);
251 frm
.setupReportTable(rep
, REPORT_TITLE_NOTICES_SENT_NOT_DELIVERED
, cols
, data
);
252 frm
.setVisible (true);
253 }//GEN-LAST:event_menuNoticesSentNotYetDeliveredActionPerformed
255 private void menuNoticeDraftAwaitingApprovalActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuNoticeDraftAwaitingApprovalActionPerformed
256 // TODO add your handling code here:
257 NoticesReportViewDialog frm
= new NoticesReportViewDialog(this, false);
258 String cols
[] = {"Reference Number", "Description", "Entrustment Date", "Client"};
260 ArrayList
<Object
> data
= Utility
.getReportData(rep
, -1);
262 JOptionPane
.showMessageDialog(this, ERROR_DISPLAYING_REPORT
);
265 frm
.setupReportTable(rep
, REPORT_TITLE_DRAFTS_AWAITING_APPROVAL
, cols
, data
);
266 frm
.setVisible(true);
267 }//GEN-LAST:event_menuNoticeDraftAwaitingApprovalActionPerformed
269 private void menuNoticesClarificationPendingActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuNoticesClarificationPendingActionPerformed
270 // TODO add your handling code here:
271 NoticesReportViewDialog frm
= new NoticesReportViewDialog(this, false);
272 String cols
[] = {"Reference Number", "Description", "Entrustment Date",
273 "Clarification Remarks", "Client" };
275 ArrayList
<Object
> data
= Utility
.getReportData(rep
, -1);
277 JOptionPane
.showMessageDialog(this, ERROR_DISPLAYING_REPORT
);
280 frm
.setupReportTable(rep
, REPORT_TITLE_CLARIFICATIONS_PENDING
, cols
, data
);
281 frm
.setVisible(true);
282 }//GEN-LAST:event_menuNoticesClarificationPendingActionPerformed
284 private void menuNoticesToBeDraftedActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuNoticesToBeDraftedActionPerformed
285 // TODO add your handling code here:
286 NoticesReportViewDialog frm
= new NoticesReportViewDialog(this, false);
287 String cols
[] = {"Reference Number", "Description", "Entrustment Date",
288 "Clarification Remarks", "Client" };
290 ArrayList
<Object
> data
= Utility
.getReportData(rep
, -1);
292 JOptionPane
.showMessageDialog(this , ERROR_DISPLAYING_REPORT
);
295 frm
.setupReportTable(rep
, REPORT_TITLE_TO_BE_DRAFTED
, cols
, data
);
296 frm
.setVisible(true);
298 }//GEN-LAST:event_menuNoticesToBeDraftedActionPerformed
299 private static final String REPORT_TITLE_TO_BE_DRAFTED
= "To Be Drafted";
300 private static final String REPORT_TITLE_CLARIFICATIONS_PENDING
= "Clarifications Pending";
301 private static final String REPORT_TITLE_DRAFTS_AWAITING_APPROVAL
= "Drafts To Be Approved";
302 public static final String REPORT_TITLE_NOTICES_SENT_NOT_DELIVERED
= "Notices Sent Not Yet Delivered";
303 public static final String ERROR_DISPLAYING_REPORT
= "Error displaying report";
304 public static final String REPORT_TITLE_BILLS_AWAITING_PAYMENT
= "Bills Awaiting Payment";
307 * @param args the command line arguments
309 public static void main(String args
[]) {
310 /* Set the Nimbus look and feel */
311 //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
312 /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
313 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
316 for (javax
.swing
.UIManager
.LookAndFeelInfo info
: javax
.swing
.UIManager
.getInstalledLookAndFeels()) {
317 if ("Nimbus".equals(info
.getName())) {
318 javax
.swing
.UIManager
.setLookAndFeel(info
.getClassName());
322 } catch (ClassNotFoundException ex
) {
323 java
.util
.logging
.Logger
.getLogger(MainFrame
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
324 } catch (InstantiationException ex
) {
325 java
.util
.logging
.Logger
.getLogger(MainFrame
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
326 } catch (IllegalAccessException ex
) {
327 java
.util
.logging
.Logger
.getLogger(MainFrame
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
328 } catch (javax
.swing
.UnsupportedLookAndFeelException ex
) {
329 java
.util
.logging
.Logger
.getLogger(MainFrame
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
333 /* Create and display the form */
334 java
.awt
.EventQueue
.invokeLater(new Runnable() {
336 new MainFrame().setVisible(true);
341 // Variables declaration - do not modify//GEN-BEGIN:variables
342 private javax
.swing
.JMenuBar jMenuBar1
;
343 private javax
.swing
.JPopupMenu
.Separator jSeparator1
;
344 private javax
.swing
.JMenuItem menuAwaitingPayment
;
345 private javax
.swing
.JMenuItem menuClientMaster
;
346 private javax
.swing
.JMenuItem menuCreateNotice
;
347 private javax
.swing
.JMenuItem menuDatabaseSettings
;
348 private javax
.swing
.JMenuItem menuGenerateRaisedBills
;
349 private javax
.swing
.JMenu menuLawyerNotices
;
350 private javax
.swing
.JMenuItem menuManageNotices
;
351 private javax
.swing
.JMenu menuMaster
;
352 private javax
.swing
.JMenuItem menuNoticeDraftAwaitingApproval
;
353 private javax
.swing
.JMenuItem menuNoticesClarificationPending
;
354 private javax
.swing
.JMenu menuNoticesReports
;
355 private javax
.swing
.JMenuItem menuNoticesSentNotYetDelivered
;
356 private javax
.swing
.JMenuItem menuNoticesToBeDrafted
;
357 private javax
.swing
.JMenu menuSettings
;
358 private javax
.swing
.JMenuItem menuStationery
;
359 // End of variables declaration//GEN-END:variables