X-Git-Url: https://harishankar.org/repos/?p=habeas.git;a=blobdiff_plain;f=src%2Fhabeas%2FViewNoticeDialog.java;fp=src%2Fhabeas%2FViewNoticeDialog.java;h=e923531d57983333b4e734095182790320db712c;hp=0000000000000000000000000000000000000000;hb=67bb9fdd9ae3818a92a528d14d82baae0d483508;hpb=5b12182f8ba1ad6811d37ba582095b45a34fde2f 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); + } +}