From 67bb9fdd9ae3818a92a528d14d82baae0d483508 Mon Sep 17 00:00:00 2001 From: Harishankar Date: Tue, 31 Mar 2020 17:16:01 +0530 Subject: [PATCH] Manage Legal Notices - View Created the functionality for viewing a legal notice. --- src/habeas/Habeas.java | 8 +- src/habeas/MainFrame.form | 1 + src/habeas/MainFrame.java | 1 + src/habeas/ManageNoticesDialog.form | 9 + src/habeas/ManageNoticesDialog.java | 34 +++ src/habeas/Utility.java | 5 +- src/habeas/ViewNoticeDialog.form | 343 ++++++++++++++++++++++++++ src/habeas/ViewNoticeDialog.java | 362 ++++++++++++++++++++++++++++ 8 files changed, 755 insertions(+), 8 deletions(-) create mode 100644 src/habeas/ViewNoticeDialog.form create mode 100644 src/habeas/ViewNoticeDialog.java diff --git a/src/habeas/Habeas.java b/src/habeas/Habeas.java index b1782f3..ae8052b 100644 --- a/src/habeas/Habeas.java +++ b/src/habeas/Habeas.java @@ -25,13 +25,7 @@ public class Habeas { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); - } catch (ClassNotFoundException ex) { - Logger.getLogger(Habeas.class.getName()).log(Level.SEVERE, null, ex); - } catch (InstantiationException ex) { - Logger.getLogger(Habeas.class.getName()).log(Level.SEVERE, null, ex); - } catch (IllegalAccessException ex) { - Logger.getLogger(Habeas.class.getName()).log(Level.SEVERE, null, ex); - } catch (UnsupportedLookAndFeelException ex) { + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { Logger.getLogger(Habeas.class.getName()).log(Level.SEVERE, null, ex); } diff --git a/src/habeas/MainFrame.form b/src/habeas/MainFrame.form index 08f47f7..5113978 100644 --- a/src/habeas/MainFrame.form +++ b/src/habeas/MainFrame.form @@ -12,6 +12,7 @@ + diff --git a/src/habeas/MainFrame.java b/src/habeas/MainFrame.java index a03494b..30458d6 100644 --- a/src/habeas/MainFrame.java +++ b/src/habeas/MainFrame.java @@ -43,6 +43,7 @@ public class MainFrame extends javax.swing.JFrame { menuMaster.setMnemonic('M'); menuMaster.setText("Master"); + menuClientMaster.setMnemonic('c'); menuClientMaster.setText("Client Master..."); menuClientMaster.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { diff --git a/src/habeas/ManageNoticesDialog.form b/src/habeas/ManageNoticesDialog.form index 4d0bbb4..2377dca 100644 --- a/src/habeas/ManageNoticesDialog.form +++ b/src/habeas/ManageNoticesDialog.form @@ -56,6 +56,15 @@ + + + + + + + + + diff --git a/src/habeas/ManageNoticesDialog.java b/src/habeas/ManageNoticesDialog.java index 1836c70..5ccdb15 100644 --- a/src/habeas/ManageNoticesDialog.java +++ b/src/habeas/ManageNoticesDialog.java @@ -53,6 +53,7 @@ public class ManageNoticesDialog extends javax.swing.JDialog { menuDispatchDetails = new javax.swing.JMenuItem(); menuBillDetails = new javax.swing.JMenuItem(); jSeparator1 = new javax.swing.JPopupMenu.Separator(); + menuView = new javax.swing.JMenuItem(); menuDelete = new javax.swing.JMenuItem(); jScrollPane1 = new javax.swing.JScrollPane(); tableNotices = new javax.swing.JTable(); @@ -104,6 +105,15 @@ public class ManageNoticesDialog extends javax.swing.JDialog { popMenu.add(menuBillDetails); popMenu.add(jSeparator1); + menuView.setMnemonic('V'); + menuView.setText("View..."); + menuView.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + menuViewActionPerformed(evt); + } + }); + popMenu.add(menuView); + menuDelete.setText("Delete"); menuDelete.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -234,6 +244,29 @@ public class ManageNoticesDialog extends javax.swing.JDialog { populateNotices(); } }//GEN-LAST:event_menuDeleteActionPerformed + + private void menuViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuViewActionPerformed + // TODO add your handling code here: + int selid = getSelectedNotice(); + if (selid == -1) return; + ArrayList notice = Utility.getNoticeDetails(selid); + if (notice == null) return; + + ViewNoticeDialog frm = new ViewNoticeDialog( + (Frame)this.getParent(), true); + frm.setFields (selid, (String)notice.get(0), + (String)notice.get(1), (Date)notice.get(2), + (String)notice.get(16), (boolean)notice.get(4), + (boolean)notice.get(5), (boolean)notice.get(6), + (Date)notice.get(7), (String)notice.get(8), + (boolean)notice.get(9), (Date)notice.get(10), + (String)notice.get(11), (int)notice.get(12), + (Date)notice.get(13), (boolean)notice.get(14), + (String)notice.get(15)); + frm.setVisible(true); + + + }//GEN-LAST:event_menuViewActionPerformed private static final String ERROR_DELETING = "Error in deleting"; private static final String CONFIRM_DELETE = "Are you sure you wish to delete?"; @@ -288,6 +321,7 @@ public class ManageNoticesDialog extends javax.swing.JDialog { private javax.swing.JMenuItem menuDescription; private javax.swing.JMenuItem menuDispatchDetails; private javax.swing.JMenuItem menuDraftStatus; + private javax.swing.JMenuItem menuView; private javax.swing.JPopupMenu popMenu; private javax.swing.JTable tableNotices; // End of variables declaration//GEN-END:variables diff --git a/src/habeas/Utility.java b/src/habeas/Utility.java index aac247c..0e6d9eb 100644 --- a/src/habeas/Utility.java +++ b/src/habeas/Utility.java @@ -175,7 +175,9 @@ public class Utility { ArrayList notice = new ArrayList<>(); try { Connection conn = DriverManager.getConnection(JDBC + connectionURL); - PreparedStatement st = conn.prepareStatement("SELECT * FROM legalnotices WHERE id=?;"); + PreparedStatement st = conn.prepareStatement("SELECT legalnotices.*, clients.ClientName " + + "FROM legalnotices " + + "INNER JOIN clients WHERE ClientId=clients.id AND legalnotices.id=?;"); st.setInt(1, selid); ResultSet rs = st.executeQuery(); while (rs.next()) { @@ -195,6 +197,7 @@ public class Utility { notice.add (getValidDate (rs, "BillDate")); notice.add (rs.getBoolean ("ClarificationPending")); notice.add (rs.getString("ClarificationRemarks")); + notice.add (rs.getString("ClientName")); } return notice; } catch (SQLException ex) { diff --git a/src/habeas/ViewNoticeDialog.form b/src/habeas/ViewNoticeDialog.form new file mode 100644 index 0000000..cbe9e09 --- /dev/null +++ b/src/habeas/ViewNoticeDialog.form @@ -0,0 +1,343 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/habeas/ViewNoticeDialog.java b/src/habeas/ViewNoticeDialog.java new file mode 100644 index 0000000..e923531 --- /dev/null +++ b/src/habeas/ViewNoticeDialog.java @@ -0,0 +1,362 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package habeas; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * + * @author hari + */ +public class ViewNoticeDialog extends javax.swing.JDialog { + + /** + * Creates new form ViewNoticeDialog + */ + public ViewNoticeDialog(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + jPanel1 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + textReferenceNumber = new javax.swing.JTextField(); + jLabel2 = new javax.swing.JLabel(); + jScrollPane2 = new javax.swing.JScrollPane(); + textDescription = new javax.swing.JTextArea(); + jLabel3 = new javax.swing.JLabel(); + textEntrustmentDate = new javax.swing.JTextField(); + jLabel4 = new javax.swing.JLabel(); + textClientName = new javax.swing.JTextField(); + checkDraftCreated = new javax.swing.JCheckBox(); + checkDraftApproved = new javax.swing.JCheckBox(); + checkNoticeSent = new javax.swing.JCheckBox(); + jLabel5 = new javax.swing.JLabel(); + textSentDate = new javax.swing.JTextField(); + jLabel6 = new javax.swing.JLabel(); + textRPADReference = new javax.swing.JTextField(); + checkNoticeDelivered = new javax.swing.JCheckBox(); + jLabel7 = new javax.swing.JLabel(); + textDeliveryDate = new javax.swing.JTextField(); + jLabel8 = new javax.swing.JLabel(); + textBillStatus = new javax.swing.JTextField(); + jLabel9 = new javax.swing.JLabel(); + jLabel10 = new javax.swing.JLabel(); + textBillDate = new javax.swing.JTextField(); + valBillAmount = new javax.swing.JFormattedTextField(); + checkClarificationPending = new javax.swing.JCheckBox(); + jLabel11 = new javax.swing.JLabel(); + jScrollPane3 = new javax.swing.JScrollPane(); + textClarificationRemarks = new javax.swing.JTextArea(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("View Notice"); + setLocationByPlatform(true); + + jLabel1.setText("Reference Number"); + + textReferenceNumber.setEditable(false); + + jLabel2.setText("Description"); + + textDescription.setEditable(false); + textDescription.setColumns(20); + textDescription.setRows(5); + jScrollPane2.setViewportView(textDescription); + + jLabel3.setText("Entrustment Date"); + + textEntrustmentDate.setEditable(false); + + jLabel4.setText("Client"); + + textClientName.setEditable(false); + + checkDraftCreated.setText("Draft Created"); + checkDraftCreated.setEnabled(false); + + checkDraftApproved.setText("Draft Approved"); + checkDraftApproved.setEnabled(false); + + checkNoticeSent.setText("Notice Sent"); + checkNoticeSent.setEnabled(false); + + jLabel5.setText("Sent Date"); + + textSentDate.setEditable(false); + + jLabel6.setText("RPAD Reference"); + + textRPADReference.setEditable(false); + + checkNoticeDelivered.setText("Notice Delivered"); + checkNoticeDelivered.setEnabled(false); + + jLabel7.setText("Delivery Date"); + + textDeliveryDate.setEditable(false); + + jLabel8.setText("Bill Status"); + + textBillStatus.setEditable(false); + + jLabel9.setText("Bill Amount"); + + jLabel10.setText("Bill Date"); + + textBillDate.setEditable(false); + + valBillAmount.setEditable(false); + valBillAmount.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(java.text.NumberFormat.getIntegerInstance()))); + + checkClarificationPending.setText("Clarification pending"); + checkClarificationPending.setEnabled(false); + + jLabel11.setText("Clarification Remarks"); + + textClarificationRemarks.setEditable(false); + textClarificationRemarks.setColumns(20); + textClarificationRemarks.setRows(5); + jScrollPane3.setViewportView(textClarificationRemarks); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE) + .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)) + .addComponent(checkDraftCreated, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(15, 15, 15) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(textDeliveryDate) + .addComponent(textReferenceNumber) + .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE) + .addComponent(textEntrustmentDate) + .addComponent(textClientName) + .addComponent(checkDraftApproved, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(textSentDate) + .addComponent(textRPADReference) + .addComponent(textBillStatus) + .addComponent(textBillDate) + .addComponent(valBillAmount) + .addComponent(checkClarificationPending, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(checkNoticeDelivered, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(checkNoticeSent, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jScrollPane3)) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(textReferenceNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(8, 8, 8) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(textEntrustmentDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(textClientName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(checkDraftCreated) + .addComponent(checkDraftApproved)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(checkNoticeSent) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(textSentDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(textRPADReference, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addComponent(checkNoticeDelivered) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(textDeliveryDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel8) + .addComponent(textBillStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel9) + .addComponent(valBillAmount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel10) + .addComponent(textBillDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(checkClarificationPending) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel11) + .addGap(0, 60, Short.MAX_VALUE)) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) + .addContainerGap()) + ); + + jScrollPane1.setViewportView(jPanel1); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane1) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 347, Short.MAX_VALUE) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + // + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(ViewNoticeDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(ViewNoticeDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(ViewNoticeDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(ViewNoticeDialog.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + // + + /* Create and display the dialog */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + ViewNoticeDialog dialog = new ViewNoticeDialog(new javax.swing.JFrame(), true); + dialog.addWindowListener(new java.awt.event.WindowAdapter() { + @Override + public void windowClosing(java.awt.event.WindowEvent e) { + System.exit(0); + } + }); + dialog.setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox checkClarificationPending; + private javax.swing.JCheckBox checkDraftApproved; + private javax.swing.JCheckBox checkDraftCreated; + private javax.swing.JCheckBox checkNoticeDelivered; + private javax.swing.JCheckBox checkNoticeSent; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel10; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JPanel jPanel1; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JScrollPane jScrollPane3; + private javax.swing.JTextField textBillDate; + private javax.swing.JTextField textBillStatus; + private javax.swing.JTextArea textClarificationRemarks; + private javax.swing.JTextField textClientName; + private javax.swing.JTextField textDeliveryDate; + private javax.swing.JTextArea textDescription; + private javax.swing.JTextField textEntrustmentDate; + private javax.swing.JTextField textRPADReference; + private javax.swing.JTextField textReferenceNumber; + private javax.swing.JTextField textSentDate; + private javax.swing.JFormattedTextField valBillAmount; + // End of variables declaration//GEN-END:variables + + void setFields(int selid, String reference_number, + String description, Date entrustment_date, String client_name, + boolean draft_created, boolean draft_approved, + boolean notice_sent, Date sent_date, String rpad_reference, + boolean notice_delivered, Date delivery_date, + String bill_status, int bill_amount, Date bill_date, + boolean clarification_pending, String clarification_remarks) { + DateFormat fmt = new SimpleDateFormat("dd/MM/yyyy"); + + textReferenceNumber.setText(reference_number); + textDescription.setText(description); + textEntrustmentDate.setText(entrustment_date == null ? "" : fmt.format(entrustment_date)); + textClientName.setText(client_name); + checkDraftCreated.setSelected(draft_created); + checkDraftApproved.setSelected(draft_approved); + checkNoticeSent.setSelected(notice_sent); + textSentDate.setText(sent_date == null ? "" : fmt.format(sent_date)); + textRPADReference.setText(rpad_reference); + checkNoticeDelivered.setSelected(notice_delivered); + textDeliveryDate.setText(delivery_date == null ? "" : fmt.format(delivery_date)); + textBillStatus.setText(bill_status); + valBillAmount.setValue(bill_amount); + textBillDate.setText (bill_date == null ? "" : fmt.format(bill_date)); + checkClarificationPending.setSelected(clarification_pending); + textClarificationRemarks.setText(clarification_remarks); + } +} -- 2.20.1