Java tutorial
/* Optical Workshop Monitoring System is a desktop application to fulfill the workflow control requirement at IRDE (DRDO) Dehradun. Copyright (C) 2014 Mayank Chaudhari (devil15) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. For any query mail me at m.charly3015@gmail.com */ package opticalworkshopmonitoringsystem; import com.itextpdf.text.Chunk; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Font; import com.itextpdf.text.Paragraph; import com.itextpdf.text.pdf.PdfWriter; import java.beans.Beans; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.persistence.RollbackException; import javax.swing.JFileChooser; import javax.swing.JOptionPane; /** * * @author devil15 */ public class PolishingDivisionView extends javax.swing.JFrame { /** * Creates new form PolishingDivisionView */ public PolishingDivisionView() { initComponents(); if (!Beans.isDesignTime()) { entityManager.getTransaction().begin(); } } /** * 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() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence .createEntityManagerFactory("drdo?zeroDateTimeBehavior=convertToNullPU") .createEntityManager(); polishingQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT p FROM Polishing p"); polishingList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : polishingQuery.getResultList(); jScrollPane1 = new javax.swing.JScrollPane(); jPanel1 = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jTextField4 = new javax.swing.JTextField(); jTextField5 = new javax.swing.JTextField(); jTextField6 = new javax.swing.JTextField(); jTextField7 = new javax.swing.JTextField(); jTextField8 = new javax.swing.JTextField(); jTextField9 = new javax.swing.JTextField(); jPanel3 = new javax.swing.JPanel(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); jTextField10 = new javax.swing.JTextField(); jTextField11 = new javax.swing.JTextField(); jTextField12 = new javax.swing.JTextField(); jTextField13 = new javax.swing.JTextField(); jTextField14 = new javax.swing.JTextField(); jPanel4 = new javax.swing.JPanel(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jTextField18 = new javax.swing.JTextField(); jTextField19 = new javax.swing.JTextField(); jPanel5 = new javax.swing.JPanel(); jLabel23 = new javax.swing.JLabel(); jLabel24 = new javax.swing.JLabel(); jLabel25 = new javax.swing.JLabel(); jLabel26 = new javax.swing.JLabel(); jLabel27 = new javax.swing.JLabel(); jTextField23 = new javax.swing.JTextField(); jTextField24 = new javax.swing.JTextField(); jTextField25 = new javax.swing.JTextField(); jTextField26 = new javax.swing.JTextField(); jTextField27 = new javax.swing.JTextField(); jTextField1 = new javax.swing.JTextField(); jTextField2 = new javax.swing.JTextField(); jTextField3 = new javax.swing.JTextField(); jButton3 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Polishing Division View"); jScrollPane2.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings .createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, polishingList, jTable1); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${project}")); columnBinding.setColumnName("Project"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${component}")); columnBinding.setColumnName("Component"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${totalPolishingTime}")); columnBinding.setColumnName("Total Polishing Time"); columnBinding.setColumnClass(Integer.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${inspectionTime}")); columnBinding.setColumnName("Inspection Time"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${inspectionEndDate}")); columnBinding.setColumnName("Inspection End Date"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${inspectionStartDate}")); columnBinding.setColumnName("Inspection Start Date"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${inspectionSurface}")); columnBinding.setColumnName("Inspection Surface"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${inspectionR}")); columnBinding.setColumnName("Inspection R"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${IStatus}")); columnBinding.setColumnName("IStatus"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${iterationNo}")); columnBinding.setColumnName("Iteration No"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${MTestplateCave}")); columnBinding.setColumnName("MTestplate Cave"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${MTestplateVex}")); columnBinding.setColumnName("MTestplate Vex"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${MTestplateD}")); columnBinding.setColumnName("MTestplate D"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${MTestplateR}")); columnBinding.setColumnName("MTestplate R"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${MUsed}")); columnBinding.setColumnName("MUsed"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${PTime}")); columnBinding.setColumnName("PTime"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${PEndDate}")); columnBinding.setColumnName("PEnd Date"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding .addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${PStartDate}")); columnBinding.setColumnName("PStart Date"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${PDueDate}")); columnBinding.setColumnName("PDue Date"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${PStatus}")); columnBinding.setColumnName("PStatus"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${PTool}")); columnBinding.setColumnName("PTool"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${pdc}")); columnBinding.setColumnName("Pdc"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane2.setViewportView(jTable1); if (jTable1.getColumnModel().getColumnCount() > 0) { jTable1.getColumnModel().getColumn(0).setMinWidth(150); jTable1.getColumnModel().getColumn(0).setPreferredWidth(150); jTable1.getColumnModel().getColumn(1).setMinWidth(150); jTable1.getColumnModel().getColumn(1).setPreferredWidth(150); } jLabel1.setText("Project"); jLabel2.setText("Component"); jLabel3.setText("Pdc"); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Polisher", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 51, 204))); jLabel4.setText("Polisher tool"); jLabel5.setText("Polisher status"); jLabel6.setText("Due on date"); jLabel7.setText("Start date"); jLabel8.setText("Completion date"); jLabel9.setText("Time taken"); org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.PTool}"), jTextField4, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.PStatus}"), jTextField5, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.PDueDate}"), jTextField6, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.PStartDate}"), jTextField7, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.PEndDate}"), jTextField8, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.PTime}"), jTextField9, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel4, 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) .addComponent(jLabel6, 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) .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)) .addGap(50, 50, 50) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jTextField5).addComponent(jTextField6) .addComponent(jTextField7) .addComponent(jTextField8, javax.swing.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE) .addComponent(jTextField4)) .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE))); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel4) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5).addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6).addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7).addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel8).addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel9).addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(14, 14, 14))); jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Polishing Material (Processing)", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 51, 204))); jLabel10.setText("material used"); jLabel11.setText("Testplate radius"); jLabel12.setText("Testplate diameter"); jLabel13.setText("Test plate vex radius"); jLabel14.setText("Testplate cave radius"); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.MUsed}"), jTextField10, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.MTestplateR}"), jTextField11, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.MTestplateD}"), jTextField12, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.MTestplateVex}"), jTextField13, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.MTestplateCave}"), jTextField14, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)) .addGap(50, 50, 50) .addGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jTextField11, javax.swing.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE) .addComponent(jTextField12).addComponent(jTextField13).addComponent(jTextField14) .addComponent(jTextField10)) .addGap(0, 167, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel10) .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel11).addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel12).addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel13).addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel14).addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Polishing Iteration", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 102, 204))); jLabel17.setText("No. of iteration done"); jLabel18.setText("Iteration status"); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.iterationNo}"), jTextField18, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.IStatus}"), jTextField19, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout .setHorizontalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup() .addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE) .addComponent(jLabel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(50, 50, 50) .addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jTextField18, javax.swing.GroupLayout.DEFAULT_SIZE, 207, Short.MAX_VALUE) .addComponent(jTextField19)) .addGap(0, 168, Short.MAX_VALUE))); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel17) .addComponent(jTextField18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel18).addComponent(jTextField19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Final Inspection", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 102, 204))); jLabel23.setText("Radius"); jLabel24.setText("Surface"); jLabel25.setText("Start date"); jLabel26.setText("Completion date"); jLabel27.setText("Time taken"); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.inspectionR}"), jTextField23, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.inspectionSurface}"), jTextField24, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.inspectionStartDate}"), jTextField25, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.inspectionEndDate}"), jTextField26, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.inspectionTime}"), jTextField27, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel26, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE) .addComponent(jLabel23, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel24, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel25, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel27, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(50, 50, 50) .addGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jTextField23, javax.swing.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE) .addComponent(jTextField24).addComponent(jTextField27).addComponent(jTextField25) .addComponent(jTextField26)) .addGap(0, 0, Short.MAX_VALUE))); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap().addGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel23) .addComponent(jTextField23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel24).addComponent(jTextField24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel25).addComponent(jTextField25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField26, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel26)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel27)) .addContainerGap())); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.project}"), jTextField1, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.component}"), jTextField2, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jTable1, org.jdesktop.beansbinding.ELProperty.create("${selectedElement.pdc}"), jTextField3, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jButton3.setText("Save"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jButton2.setText("Delete"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton1.setText("New"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton4.setText("Generate Report"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 582, Short.MAX_VALUE) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout .createSequentialGroup().addContainerGap().addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)) .addGap(57, 57, 57) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jTextField2, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE))) .addGroup(jPanel1Layout.createSequentialGroup().addGap(60, 60, 60).addComponent(jButton1) .addGap(44, 44, 44).addComponent(jButton2).addGap(44, 44, 44).addComponent(jButton3) .addGap(49, 49, 49).addComponent(jButton4))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1).addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2).addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3).addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton4).addComponent(jButton3).addComponent(jButton2) .addComponent(jButton1)) .addGap(20, 20, 20))); jScrollPane1.setViewportView(jPanel1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1)); bindingGroup.bind(); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed // TODO add your handling code here: try { entityManager.getTransaction().commit(); entityManager.getTransaction().begin(); } catch (RollbackException rex) { rex.printStackTrace(); entityManager.getTransaction().begin(); List<opticalworkshopmonitoringsystem.Polishing> merged = new ArrayList<opticalworkshopmonitoringsystem.Polishing>( polishingList.size()); for (opticalworkshopmonitoringsystem.Polishing t : polishingList) { merged.add(entityManager.merge(t)); } polishingList.clear(); polishingList.addAll(merged); } JOptionPane.showMessageDialog(this.getParent(), "Record Updated Successfully , PLease reload the page to view the changes"); }//GEN-LAST:event_jButton3ActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed opticalworkshopmonitoringsystem.Polishing t = new opticalworkshopmonitoringsystem.Polishing(); entityManager.persist(t); polishingList.add(t); int row = polishingList.size() - 1; jTable1.setRowSelectionInterval(row, row); jTable1.scrollRectToVisible(jTable1.getCellRect(row, 0, true)); }//GEN-LAST:event_jButton1ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: int[] selected = jTable1.getSelectedRows(); List<opticalworkshopmonitoringsystem.Polishing> toRemove = new ArrayList<opticalworkshopmonitoringsystem.Polishing>( selected.length); for (int idx = 0; idx < selected.length; idx++) { opticalworkshopmonitoringsystem.Polishing t = polishingList .get(jTable1.convertRowIndexToModel(selected[idx])); toRemove.add(t); entityManager.remove(t); } polishingList.removeAll(toRemove); }//GEN-LAST:event_jButton2ActionPerformed private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed try { // TODO add your handling code here: Document document = new Document(); JFileChooser fc = new JFileChooser(); fc.showOpenDialog(null); PdfWriter.getInstance(document, new FileOutputStream(fc.getSelectedFile().getAbsolutePath())); document.open(); Font courierFontItalic = new Font(Font.FontFamily.COURIER, 10, Font.ITALIC); Font courierFontUnderline = new Font(Font.FontFamily.COURIER, 10, Font.UNDERLINE); Font tr = new Font(Font.FontFamily.TIMES_ROMAN, 12, Font.BOLD); Font timesRomanUnderline = new Font(Font.FontFamily.TIMES_ROMAN, 20, Font.UNDERLINE); Font helvetica = new Font(Font.FontFamily.HELVETICA, 14, Font.UNDERLINE); document.add(new Paragraph( " Polishing Division ", timesRomanUnderline)); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel1.getText(), tr)); document.add( new Chunk(" " + jTextField1.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel2.getText(), tr)); document.add( new Chunk(" " + jTextField2.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel3.getText(), tr)); document.add( new Chunk(" " + jTextField3.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(" Polisher Details ", helvetica)); document.add(new Paragraph(jLabel4.getText(), tr)); document.add( new Chunk(" " + jTextField4.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel5.getText(), tr)); document.add( new Chunk(" " + jTextField5.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel6.getText(), tr)); document.add( new Chunk(" " + jTextField6.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel7.getText(), tr)); document.add( new Chunk(" " + jTextField7.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel8.getText(), tr)); document.add( new Chunk(" " + jTextField8.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel9.getText(), tr)); document.add( new Chunk(" " + jTextField9.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add( new Paragraph(" Polishing Material(Processing) ", helvetica)); document.add(new Paragraph(jLabel10.getText(), tr)); document.add( new Chunk(" " + jTextField10.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel11.getText(), tr)); document.add( new Chunk(" " + jTextField11.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel12.getText(), tr)); document.add( new Chunk(" " + jTextField12.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel13.getText(), tr)); document.add( new Chunk(" " + jTextField13.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel14.getText(), tr)); document.add( new Chunk(" " + jTextField14.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(" Polishing Iteration ", helvetica)); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel17.getText(), tr)); document.add( new Chunk(" " + jTextField18.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel18.getText(), tr)); document.add( new Chunk(" " + jTextField19.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(" Final Inspection ", helvetica)); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel23.getText(), tr)); document.add( new Chunk(" " + jTextField23.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel24.getText(), tr)); document.add( new Chunk(" " + jTextField24.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel25.getText(), tr)); document.add( new Chunk(" " + jTextField25.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel26.getText(), tr)); document.add( new Chunk(" " + jTextField26.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph(jLabel27.getText(), tr)); document.add( new Chunk(" " + jTextField27.getText())); document.add(new Paragraph( "----------------------------------------------------------------------------------------------------------------------------------")); document.add(new Paragraph( " ")); document.add(new Paragraph( " ")); document.add(new Paragraph( " ")); document.add(new Paragraph( " ")); document.add(new Paragraph( " Prepared by Checked by Approved by ")); document.close(); JOptionPane.showMessageDialog(null, "report generated successfully"); } catch (DocumentException ex) { Logger.getLogger(PolishingDivisionView.class.getName()).log(Level.SEVERE, null, ex); } catch (FileNotFoundException ex) { Logger.getLogger(PolishingDivisionView.class.getName()).log(Level.SEVERE, null, ex); } }//GEN-LAST:event_jButton4ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* 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(PolishingDivisionView.class.getName()) .log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(PolishingDivisionView.class.getName()) .log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(PolishingDivisionView.class.getName()) .log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(PolishingDivisionView.class.getName()) .log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new PolishingDivisionView().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.persistence.EntityManager entityManager; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel17; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel26; private javax.swing.JLabel jLabel27; 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.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTable jTable1; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField10; private javax.swing.JTextField jTextField11; private javax.swing.JTextField jTextField12; private javax.swing.JTextField jTextField13; private javax.swing.JTextField jTextField14; private javax.swing.JTextField jTextField18; private javax.swing.JTextField jTextField19; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField23; private javax.swing.JTextField jTextField24; private javax.swing.JTextField jTextField25; private javax.swing.JTextField jTextField26; private javax.swing.JTextField jTextField27; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; private javax.swing.JTextField jTextField8; private javax.swing.JTextField jTextField9; private java.util.List<opticalworkshopmonitoringsystem.Polishing> polishingList; private javax.persistence.Query polishingQuery; private org.jdesktop.beansbinding.BindingGroup bindingGroup; // End of variables declaration//GEN-END:variables }