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 menuNoticeDraftsApprovedToBeSent
= new javax
.swing
.JMenuItem();
46 menuNoticesSentNotYetDelivered
= new javax
.swing
.JMenuItem();
47 menuAwaitingPayment
= new javax
.swing
.JMenuItem();
48 menuSettings
= new javax
.swing
.JMenu();
49 menuDatabaseSettings
= new javax
.swing
.JMenuItem();
50 menuStationery
= new javax
.swing
.JMenuItem();
52 setDefaultCloseOperation(javax
.swing
.WindowConstants
.EXIT_ON_CLOSE
);
53 setTitle("Habeas - Law Office Manager");
54 setLocationByPlatform(true);
56 menuMaster
.setMnemonic('M');
57 menuMaster
.setText("Master");
59 menuClientMaster
.setMnemonic('c');
60 menuClientMaster
.setText("Client Master...");
61 menuClientMaster
.addActionListener(new java
.awt
.event
.ActionListener() {
62 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
63 menuClientMasterActionPerformed(evt
);
66 menuMaster
.add(menuClientMaster
);
68 jMenuBar1
.add(menuMaster
);
70 menuLawyerNotices
.setMnemonic('L');
71 menuLawyerNotices
.setText("Lawyer Notices");
73 menuCreateNotice
.setMnemonic('C');
74 menuCreateNotice
.setText("Create New...");
75 menuCreateNotice
.addActionListener(new java
.awt
.event
.ActionListener() {
76 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
77 menuCreateNoticeActionPerformed(evt
);
80 menuLawyerNotices
.add(menuCreateNotice
);
82 menuManageNotices
.setMnemonic('M');
83 menuManageNotices
.setText("Manage Notices...");
84 menuManageNotices
.addActionListener(new java
.awt
.event
.ActionListener() {
85 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
86 menuManageNoticesActionPerformed(evt
);
89 menuLawyerNotices
.add(menuManageNotices
);
90 menuLawyerNotices
.add(jSeparator1
);
92 menuGenerateRaisedBills
.setMnemonic('G');
93 menuGenerateRaisedBills
.setText("Generate Raised Bills...");
94 menuGenerateRaisedBills
.addActionListener(new java
.awt
.event
.ActionListener() {
95 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
96 menuGenerateRaisedBillsActionPerformed(evt
);
99 menuLawyerNotices
.add(menuGenerateRaisedBills
);
101 menuNoticesReports
.setMnemonic('r');
102 menuNoticesReports
.setText("Reports");
104 menuNoticesToBeDrafted
.setText("To Be Drafted...");
105 menuNoticesToBeDrafted
.addActionListener(new java
.awt
.event
.ActionListener() {
106 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
107 menuNoticesToBeDraftedActionPerformed(evt
);
110 menuNoticesReports
.add(menuNoticesToBeDrafted
);
112 menuNoticesClarificationPending
.setMnemonic('c');
113 menuNoticesClarificationPending
.setText("Clarifications pending...");
114 menuNoticesClarificationPending
.addActionListener(new java
.awt
.event
.ActionListener() {
115 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
116 menuNoticesClarificationPendingActionPerformed(evt
);
119 menuNoticesReports
.add(menuNoticesClarificationPending
);
121 menuNoticeDraftAwaitingApproval
.setMnemonic('d');
122 menuNoticeDraftAwaitingApproval
.setText("Drafts to be approved...");
123 menuNoticeDraftAwaitingApproval
.addActionListener(new java
.awt
.event
.ActionListener() {
124 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
125 menuNoticeDraftAwaitingApprovalActionPerformed(evt
);
128 menuNoticesReports
.add(menuNoticeDraftAwaitingApproval
);
130 menuNoticeDraftsApprovedToBeSent
.setMnemonic('a');
131 menuNoticeDraftsApprovedToBeSent
.setText("Drafts Approved not yet sent...");
132 menuNoticeDraftsApprovedToBeSent
.addActionListener(new java
.awt
.event
.ActionListener() {
133 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
134 menuNoticeDraftsApprovedToBeSentActionPerformed(evt
);
137 menuNoticesReports
.add(menuNoticeDraftsApprovedToBeSent
);
139 menuNoticesSentNotYetDelivered
.setMnemonic('s');
140 menuNoticesSentNotYetDelivered
.setText("Notices sent not yet delivered...");
141 menuNoticesSentNotYetDelivered
.addActionListener(new java
.awt
.event
.ActionListener() {
142 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
143 menuNoticesSentNotYetDeliveredActionPerformed(evt
);
146 menuNoticesReports
.add(menuNoticesSentNotYetDelivered
);
148 menuAwaitingPayment
.setMnemonic('a');
149 menuAwaitingPayment
.setText("Bills awaiting payment...");
150 menuAwaitingPayment
.addActionListener(new java
.awt
.event
.ActionListener() {
151 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
152 menuAwaitingPaymentActionPerformed(evt
);
155 menuNoticesReports
.add(menuAwaitingPayment
);
157 menuLawyerNotices
.add(menuNoticesReports
);
159 jMenuBar1
.add(menuLawyerNotices
);
161 menuSettings
.setMnemonic('S');
162 menuSettings
.setText("Settings");
164 menuDatabaseSettings
.setMnemonic('D');
165 menuDatabaseSettings
.setText("Database...");
166 menuDatabaseSettings
.addActionListener(new java
.awt
.event
.ActionListener() {
167 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
168 menuDatabaseSettingsActionPerformed(evt
);
171 menuSettings
.add(menuDatabaseSettings
);
173 menuStationery
.setMnemonic('S');
174 menuStationery
.setText("Stationery Settings...");
175 menuStationery
.addActionListener(new java
.awt
.event
.ActionListener() {
176 public void actionPerformed(java
.awt
.event
.ActionEvent evt
) {
177 menuStationeryActionPerformed(evt
);
180 menuSettings
.add(menuStationery
);
182 jMenuBar1
.add(menuSettings
);
184 setJMenuBar(jMenuBar1
);
186 javax
.swing
.GroupLayout layout
= new javax
.swing
.GroupLayout(getContentPane());
187 getContentPane().setLayout(layout
);
188 layout
.setHorizontalGroup(
189 layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
190 .addGap(0, 586, Short
.MAX_VALUE
)
192 layout
.setVerticalGroup(
193 layout
.createParallelGroup(javax
.swing
.GroupLayout
.Alignment
.LEADING
)
194 .addGap(0, 292, Short
.MAX_VALUE
)
198 }// </editor-fold>//GEN-END:initComponents
200 private void menuDatabaseSettingsActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuDatabaseSettingsActionPerformed
201 // TODO add your handling code here:
202 DatabaseSettingsDialog frm
= new DatabaseSettingsDialog (this, true);
203 frm
.setVisible(true);
204 }//GEN-LAST:event_menuDatabaseSettingsActionPerformed
206 private void menuClientMasterActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuClientMasterActionPerformed
207 // TODO add your handling code here:
208 ClientMasterDialog frm
= new ClientMasterDialog (this, true);
209 frm
.setVisible(true);
210 }//GEN-LAST:event_menuClientMasterActionPerformed
212 private void menuCreateNoticeActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuCreateNoticeActionPerformed
213 // TODO add your handling code here:
214 CreateNoticeDialog frm
= new CreateNoticeDialog(this, true);
215 frm
.setVisible(true);
216 }//GEN-LAST:event_menuCreateNoticeActionPerformed
218 private void menuManageNoticesActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuManageNoticesActionPerformed
219 // TODO add your handling code here:
220 ManageNoticesDialog frm
= new ManageNoticesDialog(this, true);
221 frm
.setVisible(true);
222 }//GEN-LAST:event_menuManageNoticesActionPerformed
224 private void menuStationeryActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuStationeryActionPerformed
225 // TODO add your handling code here:
226 StationerySettingsDialog frm
= new StationerySettingsDialog(this, true);
227 frm
.setVisible(true);
228 }//GEN-LAST:event_menuStationeryActionPerformed
230 private void menuGenerateRaisedBillsActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuGenerateRaisedBillsActionPerformed
231 // TODO add your handling code here:
232 GenerateRaisedBillsDialog frm
= new GenerateRaisedBillsDialog(this, true);
233 frm
.setVisible(true);
235 }//GEN-LAST:event_menuGenerateRaisedBillsActionPerformed
237 private void menuAwaitingPaymentActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuAwaitingPaymentActionPerformed
238 // TODO add your handling code here:
239 NoticesReportViewDialog frm
= new NoticesReportViewDialog(this, false);
240 String
[] cols
= {"Reference Number", "Description", "Bill Date", "Bill Amount", "Client"};
242 ArrayList
<Object
> data
= Utility
.getReportData(rep
, -1);
244 JOptionPane
.showMessageDialog(this, ERROR_DISPLAYING_REPORT
);
247 frm
.setupReportTable(rep
, REPORT_TITLE_BILLS_AWAITING_PAYMENT
, cols
, data
);
248 frm
.setVisible(true);
249 }//GEN-LAST:event_menuAwaitingPaymentActionPerformed
251 private void menuNoticesSentNotYetDeliveredActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuNoticesSentNotYetDeliveredActionPerformed
252 // TODO add your handling code here:
253 NoticesReportViewDialog frm
= new NoticesReportViewDialog(this, false);
254 String
[] cols
= {"Reference Number", "Description", "Sent Date", "RPAD Reference", "Client"};
256 ArrayList
<Object
> data
= Utility
.getReportData (rep
, -1);
258 JOptionPane
.showMessageDialog(this, ERROR_DISPLAYING_REPORT
);
261 frm
.setupReportTable(rep
, REPORT_TITLE_NOTICES_SENT_NOT_DELIVERED
, cols
, data
);
262 frm
.setVisible (true);
263 }//GEN-LAST:event_menuNoticesSentNotYetDeliveredActionPerformed
265 private void menuNoticeDraftAwaitingApprovalActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuNoticeDraftAwaitingApprovalActionPerformed
266 // TODO add your handling code here:
267 NoticesReportViewDialog frm
= new NoticesReportViewDialog(this, false);
268 String cols
[] = {"Reference Number", "Description", "Entrustment Date", "Client"};
270 ArrayList
<Object
> data
= Utility
.getReportData(rep
, -1);
272 JOptionPane
.showMessageDialog(this, ERROR_DISPLAYING_REPORT
);
275 frm
.setupReportTable(rep
, REPORT_TITLE_DRAFTS_AWAITING_APPROVAL
, cols
, data
);
276 frm
.setVisible(true);
277 }//GEN-LAST:event_menuNoticeDraftAwaitingApprovalActionPerformed
279 private void menuNoticesClarificationPendingActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuNoticesClarificationPendingActionPerformed
280 // TODO add your handling code here:
281 NoticesReportViewDialog frm
= new NoticesReportViewDialog(this, false);
282 String cols
[] = {"Reference Number", "Description", "Entrustment Date",
283 "Clarification Remarks", "Client" };
285 ArrayList
<Object
> data
= Utility
.getReportData(rep
, -1);
287 JOptionPane
.showMessageDialog(this, ERROR_DISPLAYING_REPORT
);
290 frm
.setupReportTable(rep
, REPORT_TITLE_CLARIFICATIONS_PENDING
, cols
, data
);
291 frm
.setVisible(true);
292 }//GEN-LAST:event_menuNoticesClarificationPendingActionPerformed
294 private void menuNoticesToBeDraftedActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuNoticesToBeDraftedActionPerformed
295 // TODO add your handling code here:
296 NoticesReportViewDialog frm
= new NoticesReportViewDialog(this, false);
297 String cols
[] = {"Reference Number", "Description", "Entrustment Date",
298 "Clarification Remarks", "Client" };
300 ArrayList
<Object
> data
= Utility
.getReportData(rep
, -1);
302 JOptionPane
.showMessageDialog(this , ERROR_DISPLAYING_REPORT
);
305 frm
.setupReportTable(rep
, REPORT_TITLE_TO_BE_DRAFTED
, cols
, data
);
306 frm
.setVisible(true);
308 }//GEN-LAST:event_menuNoticesToBeDraftedActionPerformed
310 private void menuNoticeDraftsApprovedToBeSentActionPerformed(java
.awt
.event
.ActionEvent evt
) {//GEN-FIRST:event_menuNoticeDraftsApprovedToBeSentActionPerformed
311 // TODO add your handling code here:
312 NoticesReportViewDialog frm
= new NoticesReportViewDialog(this, false);
313 String cols
[] = {"Reference Number", "Description", "Entrustment Date",
316 ArrayList
<Object
> data
= Utility
.getReportData(rep
, -1);
318 JOptionPane
.showMessageDialog(this , ERROR_DISPLAYING_REPORT
);
321 frm
.setupReportTable(rep
, REPORT_TITLE_APPROVED_NOT_YET_SENT
, cols
, data
);
322 frm
.setVisible(true);
324 }//GEN-LAST:event_menuNoticeDraftsApprovedToBeSentActionPerformed
325 private static final String REPORT_TITLE_TO_BE_DRAFTED
= "To Be Drafted";
326 private static final String REPORT_TITLE_CLARIFICATIONS_PENDING
= "Clarifications Pending";
327 private static final String REPORT_TITLE_DRAFTS_AWAITING_APPROVAL
= "Drafts To Be Approved";
328 public static final String REPORT_TITLE_NOTICES_SENT_NOT_DELIVERED
= "Notices Sent Not Yet Delivered";
329 public static final String ERROR_DISPLAYING_REPORT
= "Error displaying report";
330 public static final String REPORT_TITLE_BILLS_AWAITING_PAYMENT
= "Bills Awaiting Payment";
331 public static final String REPORT_TITLE_APPROVED_NOT_YET_SENT
= "Drafts Approved Not Yet Sent";
333 * @param args the command line arguments
335 public static void main(String args
[]) {
336 /* Set the Nimbus look and feel */
337 //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
338 /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
339 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
342 for (javax
.swing
.UIManager
.LookAndFeelInfo info
: javax
.swing
.UIManager
.getInstalledLookAndFeels()) {
343 if ("Nimbus".equals(info
.getName())) {
344 javax
.swing
.UIManager
.setLookAndFeel(info
.getClassName());
348 } catch (ClassNotFoundException ex
) {
349 java
.util
.logging
.Logger
.getLogger(MainFrame
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
350 } catch (InstantiationException ex
) {
351 java
.util
.logging
.Logger
.getLogger(MainFrame
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
352 } catch (IllegalAccessException ex
) {
353 java
.util
.logging
.Logger
.getLogger(MainFrame
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
354 } catch (javax
.swing
.UnsupportedLookAndFeelException ex
) {
355 java
.util
.logging
.Logger
.getLogger(MainFrame
.class.getName()).log(java
.util
.logging
.Level
.SEVERE
, null, ex
);
359 /* Create and display the form */
360 java
.awt
.EventQueue
.invokeLater(new Runnable() {
362 new MainFrame().setVisible(true);
367 // Variables declaration - do not modify//GEN-BEGIN:variables
368 private javax
.swing
.JMenuBar jMenuBar1
;
369 private javax
.swing
.JPopupMenu
.Separator jSeparator1
;
370 private javax
.swing
.JMenuItem menuAwaitingPayment
;
371 private javax
.swing
.JMenuItem menuClientMaster
;
372 private javax
.swing
.JMenuItem menuCreateNotice
;
373 private javax
.swing
.JMenuItem menuDatabaseSettings
;
374 private javax
.swing
.JMenuItem menuGenerateRaisedBills
;
375 private javax
.swing
.JMenu menuLawyerNotices
;
376 private javax
.swing
.JMenuItem menuManageNotices
;
377 private javax
.swing
.JMenu menuMaster
;
378 private javax
.swing
.JMenuItem menuNoticeDraftAwaitingApproval
;
379 private javax
.swing
.JMenuItem menuNoticeDraftsApprovedToBeSent
;
380 private javax
.swing
.JMenuItem menuNoticesClarificationPending
;
381 private javax
.swing
.JMenu menuNoticesReports
;
382 private javax
.swing
.JMenuItem menuNoticesSentNotYetDelivered
;
383 private javax
.swing
.JMenuItem menuNoticesToBeDrafted
;
384 private javax
.swing
.JMenu menuSettings
;
385 private javax
.swing
.JMenuItem menuStationery
;
386 // End of variables declaration//GEN-END:variables