// handle tooltip label private void detail0_cursor_out_handler( java.awt.event.FocusEvent evt) { // GEN-FIRST:event_detail0_cursor_out_handler if (EnterDetail0.getText().length() < 1) { EnterDetail0.setText("Enter Detail"); EnterDetail0.setFont(new java.awt.Font("Tahoma", 2, 12)); EnterDetail0.setForeground(new java.awt.Color(153, 153, 153)); } } // GEN-LAST:event_detail0_cursor_out_handler
// handle tooltip label private void detail0_cursor_in_handler( java.awt.event.FocusEvent evt) { // GEN-FIRST:event_detail0_cursor_in_handler if (EnterDetail0.getText().equals("Enter Detail")) { EnterDetail0.setText(null); EnterDetail0.setFont(new java.awt.Font("Tahoma", 0, 12)); EnterDetail0.setForeground(new java.awt.Color(0, 0, 0)); } } // GEN-LAST:event_detail0_cursor_in_handler
// Ctor public JustUpdateClaimForm(long PerId, Object ClaimID, JTable jtableClaim) throws Exception { this.receivedDocumnt = new ArrayList<String>(); per_id = PerId; claim_id = Long.valueOf(ClaimID.toString()); Claimtable = jtableClaim; claim = new Claim(); claim = sngltn.GetClaimById(claim_id); int NumOfDetails = claim.getMoreDetailsSize(); initComponents(); java.awt.event.WindowEvent MyWindow = null; formWindowOpened(MyWindow); ArrayList<Documents> arr = SetReqDucmntsListByEvent(claim.getEventType()); ComboBoxEventType.setModel(new DefaultComboBoxModel(EvntType.values())); ComboBoxInsuranceClaimStatus.setModel(new DefaultComboBoxModel(ClaimStat.values())); DetailsFieldsFirstDesplay(NumOfDetails); TextPerson_Name_ID.setEnabled(false); TextPerson_Name_ID.setText( "Person Name: " + sngltn.GetMyPersonCstmrCrd(per_id).getPerson().getNamePerson() + "\n" + "Preson ID: " + Long.toString(per_id)); EnterRepresentativeName.setText(claim.getRepresentativeName()); jSpinnerClaimId.setValue(claim_id); ComboBoxInsuranceClaimStatus.setSelectedItem(claim.getInsuranceClaimStatus()); jSpinnerOpeningDate.setValue(claim.getOpeningDate()); ComboBoxEventType.setSelectedItem(claim.getEventType()); jSpinnerEventTime.setValue(claim.getEventTime()); EnterEventPlace.setText(claim.getEventPlace()); if (NumOfDetails == 1) { EnterDetail0.setText(claim.getMoreDetailsValues().get(0)); } else if (NumOfDetails == 2) { EnterDetail0.setText(claim.getMoreDetailsValues().get(0)); EnterDetail1.setText(claim.getMoreDetailsValues().get(1)); } else if (NumOfDetails == 3) { EnterDetail0.setText(claim.getMoreDetailsValues().get(0)); EnterDetail1.setText(claim.getMoreDetailsValues().get(1)); EnterDetail2.setText(claim.getMoreDetailsValues().get(2)); } else if (NumOfDetails == 4) { EnterDetail0.setText(claim.getMoreDetailsValues().get(0)); EnterDetail1.setText(claim.getMoreDetailsValues().get(1)); EnterDetail2.setText(claim.getMoreDetailsValues().get(2)); EnterDetail3.setText(claim.getMoreDetailsValues().get(3)); } try { int counter = 1; DefaultTableModel model = (DefaultTableModel) jTableDocumentsRequired.getModel(); model.setRowCount(0); for (Documents doc : arr) { model.addRow(new Object[] {String.valueOf(doc), false}); } } catch (Exception ex) { Logger.getLogger(AddCstmrCrdForm.class.getName()).log(Level.SEVERE, null, ex); } for (int i = 0; i < jTableDocumentsRequired.getRowCount(); i++) { for (String doc : claim.getDocumentsReceivedValues()) { if (jTableDocumentsRequired.getValueAt(i, 0).toString().equals(doc)) { jTableDocumentsRequired.setValueAt(true, i, 1); } } } }
/** * 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") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { EnterRepresentativeName = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jSpinnerOpeningDate = new javax.swing.JSpinner(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); EnterDetail0 = new java.awt.TextField(); EnterDetail2 = new java.awt.TextField(); EnterDetail3 = new java.awt.TextField(); EnterDetail1 = new java.awt.TextField(); jSpinnerClaimId = new javax.swing.JSpinner(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); ComboBoxEventType = new javax.swing.JComboBox(); jLabel6 = new javax.swing.JLabel(); ComboBoxInsuranceClaimStatus = new javax.swing.JComboBox(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jSpinnerEventTime = new javax.swing.JSpinner(); buttonUpdateThisClaim = new java.awt.Button(); jScrollPane1 = new javax.swing.JScrollPane(); TextPerson_Name_ID = new javax.swing.JTextPane(); buttonMinus1 = new java.awt.Button(); buttonMinus2 = new java.awt.Button(); buttonMinus3 = new java.awt.Button(); buttonPlus0 = new java.awt.Button(); buttonPlus1 = new java.awt.Button(); buttonPlus2 = new java.awt.Button(); jLabel9 = new javax.swing.JLabel(); EnterEventPlace = new javax.swing.JTextField(); jScrollPane2 = new javax.swing.JScrollPane(); jTableDocumentsRequired = new javax.swing.JTable(); jSeparator1 = new javax.swing.JSeparator(); jLabel10 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setResizable(false); addWindowListener( new java.awt.event.WindowAdapter() { public void windowClosed(java.awt.event.WindowEvent evt) { formWindowClosed(evt); } public void windowClosing(java.awt.event.WindowEvent evt) { formWindowClosing(evt); } }); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); EnterRepresentativeName.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N EnterRepresentativeName.setForeground(new java.awt.Color(0, 0, 0)); EnterRepresentativeName.setText("Enter Representative Name"); EnterRepresentativeName.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EnterRepresentativeNameActionPerformed(evt); } }); EnterRepresentativeName.addFocusListener( new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { representative_name_cursor_in_handler(evt); } public void focusLost(java.awt.event.FocusEvent evt) { representative_name_cursor_out_handler(evt); } }); getContentPane() .add( EnterRepresentativeName, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 80, 170, 30)); jLabel1.setText("Representative Name:"); getContentPane() .add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 80, 130, 30)); jSpinnerOpeningDate.setModel( new javax.swing.SpinnerDateModel( new java.util.Date(), null, null, java.util.Calendar.DAY_OF_YEAR)); jSpinnerOpeningDate.setEnabled(false); getContentPane() .add( jSpinnerOpeningDate, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 190, 165, 30)); jLabel2.setText("Opening Date:"); getContentPane() .add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 200, 106, -1)); jLabel3.setText("More Details:"); getContentPane() .add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 380, -1, -1)); EnterDetail0.setForeground(new java.awt.Color(0, 0, 0)); EnterDetail0.setMaximumSize(new java.awt.Dimension(72, 21)); EnterDetail0.setText("Enter Detail"); EnterDetail0.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EnterDetail0ActionPerformed(evt); } }); EnterDetail0.addFocusListener( new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { detail0_cursor_in_handler(evt); } public void focusLost(java.awt.event.FocusEvent evt) { detail0_cursor_out_handler(evt); } }); getContentPane() .add(EnterDetail0, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 390, 339, -1)); EnterDetail2.setForeground(new java.awt.Color(0, 0, 0)); EnterDetail2.setMaximumSize(new java.awt.Dimension(72, 21)); EnterDetail2.setText("Enter Detail"); EnterDetail2.addFocusListener( new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { detail2_cursor_in_handler(evt); } public void focusLost(java.awt.event.FocusEvent evt) { detail2_cursor_out_handler(evt); } }); getContentPane() .add(EnterDetail2, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 470, 339, -1)); EnterDetail3.setForeground(new java.awt.Color(0, 0, 0)); EnterDetail3.setMaximumSize(new java.awt.Dimension(72, 21)); EnterDetail3.setText("Enter Detail"); EnterDetail3.addFocusListener( new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { detail3_cursor_in_handler(evt); } public void focusLost(java.awt.event.FocusEvent evt) { detail3_cursor_out_handler(evt); } }); getContentPane() .add(EnterDetail3, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 510, 339, -1)); EnterDetail1.setForeground(new java.awt.Color(0, 0, 0)); EnterDetail1.setMaximumSize(new java.awt.Dimension(72, 21)); EnterDetail1.setText("Enter Detail"); EnterDetail1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { EnterDetail1ActionPerformed(evt); } }); EnterDetail1.addFocusListener( new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { detail1_cursor_in_handler(evt); } public void focusLost(java.awt.event.FocusEvent evt) { detail1_cursor_out_handler(evt); } }); getContentPane() .add(EnterDetail1, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 430, 339, -1)); jSpinnerClaimId.setBorder(javax.swing.BorderFactory.createCompoundBorder()); jSpinnerClaimId.setEnabled(false); getContentPane() .add(jSpinnerClaimId, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 120, 78, -1)); jLabel4.setText("Claim ID:"); getContentPane() .add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 120, -1, -1)); jLabel5.setText("* predetermined"); getContentPane() .add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 120, -1, -1)); ComboBoxEventType.setModel( new javax.swing.DefaultComboBoxModel( new String[] {"Item 1", "Item 2", "Item 3", "Item 4"})); ComboBoxEventType.setEnabled(false); ComboBoxEventType.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ComboBoxEventTypeActionPerformed(evt); } }); getContentPane() .add( ComboBoxEventType, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 250, 165, -1)); jLabel6.setText("Event Type:"); getContentPane() .add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 250, -1, -1)); ComboBoxInsuranceClaimStatus.setModel( new javax.swing.DefaultComboBoxModel( new String[] {"Item 1", "Item 2", "Item 3", "Item 4"})); getContentPane() .add( ComboBoxInsuranceClaimStatus, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 150, 165, -1)); jLabel7.setText("Insurance Claim Status:"); getContentPane() .add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 150, -1, -1)); jLabel8.setText("Event Time:"); getContentPane() .add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 300, 70, 20)); jSpinnerEventTime.setModel( new javax.swing.SpinnerDateModel( new java.util.Date(1397040165906L), new java.util.Date(536450400000L), null, java.util.Calendar.DAY_OF_MONTH)); getContentPane() .add( jSpinnerEventTime, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 290, 160, 30)); buttonUpdateThisClaim.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); buttonUpdateThisClaim.setLabel("Update this claim"); buttonUpdateThisClaim.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonUpdateThisClaimActionPerformed(evt); } }); getContentPane() .add( buttonUpdateThisClaim, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 130, 130, 78)); jScrollPane1.setViewportView(TextPerson_Name_ID); getContentPane() .add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 10, 322, 54)); buttonMinus1.setLabel("-"); buttonMinus1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonMinus1ActionPerformed(evt); } }); getContentPane() .add(buttonMinus1, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 430, -1, 21)); buttonMinus2.setLabel("-"); buttonMinus2.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonMinus2ActionPerformed(evt); } }); getContentPane() .add(buttonMinus2, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 470, -1, 19)); buttonMinus3.setLabel("-"); buttonMinus3.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonMinus3ActionPerformed(evt); } }); getContentPane() .add(buttonMinus3, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 510, -1, 20)); buttonPlus0.setLabel("+"); buttonPlus0.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonPlus0ActionPerformed(evt); } }); getContentPane() .add(buttonPlus0, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 390, -1, 21)); buttonPlus1.setLabel("+"); buttonPlus1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonPlus1ActionPerformed(evt); } }); getContentPane() .add(buttonPlus1, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 430, -1, 21)); buttonPlus2.setLabel("+"); buttonPlus2.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { buttonPlus2ActionPerformed(evt); } }); getContentPane() .add(buttonPlus2, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 470, -1, 21)); jLabel9.setText("Event Place:"); getContentPane() .add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 340, -1, -1)); EnterEventPlace.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N EnterEventPlace.setForeground(new java.awt.Color(0, 0, 0)); EnterEventPlace.setText("Enter Place"); EnterEventPlace.addFocusListener( new java.awt.event.FocusAdapter() { public void focusGained(java.awt.event.FocusEvent evt) { event_place_cursor_in_handler(evt); } public void focusLost(java.awt.event.FocusEvent evt) { event_place_cursor_out_handler(evt); } }); getContentPane() .add(EnterEventPlace, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 340, 100, -1)); jTableDocumentsRequired.setModel( new javax.swing.table.DefaultTableModel( new Object[][] {}, new String[] {"Document", "Received (Y/N)"}) { Class[] types = new Class[] {java.lang.Object.class, java.lang.Boolean.class}; boolean[] canEdit = new boolean[] {false, true}; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jScrollPane2.setViewportView(jTableDocumentsRequired); if (jTableDocumentsRequired.getColumnModel().getColumnCount() > 0) { jTableDocumentsRequired.getColumnModel().getColumn(0).setPreferredWidth(15); jTableDocumentsRequired.getColumnModel().getColumn(1).setPreferredWidth(2); } getContentPane() .add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 250, 190, 110)); getContentPane() .add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 230, 300, 10)); jLabel10.setText("Documents Required:"); getContentPane() .add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 230, 130, 20)); pack(); } // </editor-fold>//GEN-END:initComponents