You are on page 1of 15

/* * To change this template, choose Tools | Templates * and open the template in the editor.

*/ package akshaynokia; import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import import akshaynokia.readzdyi; static akshaynokia.readzdyi.stu; static akshaynokia.readzqri.readifge0; java.io.File; java.io.FileInputStream; java.io.FileNotFoundException; java.io.FileOutputStream; java.io.IOException; java.io.File; java.io.FileInputStream; java.io.FileNotFoundException; java.io.FileOutputStream; java.io.IOException; java.util.ArrayList; java.util.Date; java.util.HashMap; java.util.Iterator; java.util.Map; java.util.Set; org.apache.poi.hpsf.HPSFException; org.apache.poi.hssf.usermodel.HSSFCell; org.apache.poi.hssf.usermodel.HSSFCellStyle; org.apache.poi.hssf.usermodel.HSSFRow; org.apache.poi.hssf.usermodel.HSSFSheet; org.apache.poi.hssf.usermodel.HSSFWorkbook; org.apache.poi.ss.usermodel.Cell; org.apache.poi.ss.usermodel.Row; java.io.File; java.io.FileInputStream; java.io.FileNotFoundException; java.io.FileOutputStream; java.io.IOException; java.text.SimpleDateFormat; java.util.Scanner; java.util.StringTokenizer; org.apache.poi.hssf.extractor.ExcelExtractor; org.apache.poi.ss.usermodel.Font; org.apache.poi.ss.usermodel.Workbook;

/** * * @author Sony */ public class ui extends javax.swing.JFrame { /** * Creates new form ui */ public ui() { 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") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); name = new javax.swing.JTextField(); node = new javax.swing.JTextField(); hw = new javax.swing.JTextField(); path = new javax.swing.JTextField(); newpath = new javax.swing.JTextField(); cover = new javax.swing.JButton(); version = new javax.swing.JButton(); userplane = new javax.swing.JButton(); jLabel6 = new javax.swing.JLabel(); ATM = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenu2 = new javax.swing.JMenu(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setText("NAME :"); jLabel2.setText("NODE NAME :"); jLabel3.setText("HARDWARE :"); jLabel4.setText("PATH :"); jLabel5.setText("NEW FILE PATH :"); name.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nameActionPerformed(evt); } }); node.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nodeActionPerformed(evt); } }); path.setText("C:\\\\Users\\\\Sony\\\\Desktop\\\\MGW10.txt"); newpath.setText("F:/sut11.xls");

newpath.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newpathActionPerformed(evt); } }); cover.setText("Cover"); cover.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { coverActionPerformed(evt); } }); version.setText("Version"); version.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { versionActionPerformed(evt); } }); userplane.setText("NODE NAME"); userplane.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { userplaneActionPerformed(evt); } }); jLabel6.setText("Global Title :"); ATM.setText("919892002310"); ATM.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ATMActionPerformed(evt); } }); jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/aksha ynokia/images.jpg"))); // NOI18N jLabel8.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel8.setText("PLEASE ENTER THE REQUIRED DETAILS"); jButton1.setText("Synchroniztion"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("O&M IP TABLE"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setText("Generate complete sheet"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt);

} }); jMenu1.setText("File"); jMenuBar1.add(jMenu1); jMenu2.setText("Edit"); jMenuBar1.add(jMenu2); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentP ane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING ) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createS equentialGroup() .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 3 71, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELA TED, 40, Short.MAX_VALUE) .addComponent(jLabel7)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali gnment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING, false) .addComponent(jButton1, javax.swing.GroupLayout.DEFA ULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(cover, javax.swing.GroupLayout.DEFAULT _SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacem ent.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING, false) .addComponent(version, javax.swing.GroupLayout.DEFAU LT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton2, javax.swing.GroupLayout.DEFA ULT_SIZE, 106, Short.MAX_VALUE)) .addGap(96, 96, 96) .addGroup(layout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING, false) .addComponent(userplane, javax.swing.GroupLayout.DEF AULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton3, javax.swing.GroupLayout.DEFA ULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING) .addComponent(jLabel4) .addComponent(jLabel5) .addComponent(jLabel2) .addComponent(jLabel6) .addComponent(jLabel3) .addComponent(jLabel1, javax.swing.GroupLayout.PREFE RRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))

.addGap(45, 45, 45) .addGroup(layout.createParallelGroup(javax.swing.GroupLa yout.Alignment.LEADING) .addComponent(ATM) .addComponent(name) .addComponent(hw, javax.swing.GroupLayout.Alignment. TRAILING) .addComponent(node) .addComponent(path, javax.swing.GroupLayout.Alignmen t.TRAILING) .addComponent(newpath)))) .addGap(91, 91, 91)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING ) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali gnment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_S IZE, 74, Short.MAX_VALUE) .addGap(41, 41, 41)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED _SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacem ent.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali gnment.BASELINE) .addComponent(name, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELA TED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali gnment.BASELINE) .addComponent(node, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELA TED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali gnment.BASELINE) .addComponent(hw, javax.swing.GroupLayout.PREFERRED_SIZE, 25 , javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELA TED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali gnment.BASELINE) .addComponent(path, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRE LATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali gnment.BASELINE) .addComponent(newpath, javax.swing.GroupLayout.PREFERRED_SIZ E, 22, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel5)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali gnment.LEADING) .addComponent(jLabel6) .addComponent(ATM, javax.swing.GroupLayout.PREFERRED_SIZE, j avax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(74, 74, 74) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali gnment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout .Alignment.BASELINE) .addComponent(cover) .addComponent(version)) .addComponent(userplane)) .addGap(32, 32, 32) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali gnment.BASELINE) .addComponent(jButton1) .addComponent(jButton2) .addComponent(jButton3)) .addGap(39, 39, 39)) ); pack(); }// </editor-fold> private void nameActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void coverActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: String aks = node.getText(); String aks1 = path.getText(); String aks2 = newpath.getText(); HSSFWorkbook workbook = null; try { FileInputStream file = new FileInputStream(new File("F:/AKSHAYPAHUJA 1.xls")); workbook = new HSSFWorkbook(file); HSSFSheet sheet = workbook.getSheetAt(0); Cell cell = null; cell = sheet.getRow(5).getCell(4); cell.setCellValue(aks); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException ee) { } try { FileOutputStream outFile = new FileOutputStream(new File(aks2)); workbook.write(outFile); } catch (IOException e) { e.printStackTrace(); }

} private void newpathActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void versionActionPerformed(java.awt.event.ActionEvent evt) { try { String aks5 = name.getText(); String aks7 = newpath.getText(); HSSFWorkbook workbook; try (FileInputStream file = new FileInputStream(new File("F:/version .xls"))) { workbook = new HSSFWorkbook(file); HSSFSheet sheet = workbook.getSheetAt(0); Cell cell = null; //name cell = sheet.getRow(6).getCell(4); cell.setCellValue(aks5); } try (FileOutputStream outFile = new FileOutputStream(new File(aks7)) ) { workbook.write(outFile); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }

} private void userplaneActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: try { readzusi ak = new readzusi(); String aa = ak.abc(); CharacterCounter CharacterCounter CharacterCounter CharacterCounter CharacterCounter CharacterCounter CharacterCounter CharacterCounter CharacterCounter qq = new CharacterCounter(); qq1 = new CharacterCounter(); qq2 = new CharacterCounter(); qq3 = new CharacterCounter(); qq4 = new CharacterCounter(); qq5 = new CharacterCounter(); qq6 = new CharacterCounter(); qq7 = new CharacterCounter(); qq8 = new CharacterCounter();

CharacterCounter qq9 = new CharacterCounter(); CharacterCounter qq10 = new CharacterCounter(); CharacterCounter qq11 = new CharacterCounter(); CharacterCounter qq12 = new CharacterCounter(); int MXU = qq.countOccurrences("MXU", aa); int cacu = qq1.countOccurrences("CACU", aa); int cm = qq2.countOccurrences("CM", aa); int isu = qq3.countOccurrences("ISU", aa); int omu = qq4.countOccurrences("OMU", aa); int vanu = qq5.countOccurrences("VANU", aa); int tcuu = qq6.countOccurrences("TCU", aa); int sfu = qq7.countOccurrences("SFU", aa); int ehu = qq8.countOccurrences("EHU", aa); int niwu = qq9.countOccurrences("NIWU", aa); int iws1 = qq10.countOccurrences("IWS1", aa); int npgep = qq11.countOccurrences("NPGEP", aa); int tbu = qq12.countOccurrences("TBU", aa);

String nme = node.getText(); String atm = ATM.getText(); String aks7 = newpath.getText(); HSSFWorkbook workbook; try (FileInputStream file = new FileInputStream(new File("F:/nodenam e.xls"))) { workbook = new HSSFWorkbook(file); HSSFSheet sheet = workbook.getSheetAt(3); Cell cell = null;

cell = sheet.getRow(6).getCell(2); cell.setCellValue(atm); cell = sheet.getRow(15).getCell(3); cell.setCellValue(cacu);

cell = sheet.getRow(16).getCell(3); cell.setCellValue(cm); cell = sheet.getRow(17).getCell(3); cell.setCellValue(isu); cell = sheet.getRow(18).getCell(3); cell.setCellValue(omu); cell = sheet.getRow(19).getCell(3); cell.setCellValue(vanu); cell = sheet.getRow(20).getCell(3); cell.setCellValue(tcuu); cell = sheet.getRow(21).getCell(3); cell.setCellValue(MXU);

cell = sheet.getRow(22).getCell(3); cell.setCellValue(sfu); cell = sheet.getRow(23).getCell(3); cell.setCellValue(ehu); cell = sheet.getRow(25).getCell(3); cell.setCellValue(niwu); cell = sheet.getRow(26).getCell(3); cell.setCellValue(iws1); cell = sheet.getRow(27).getCell(3); cell.setCellValue(npgep); cell = sheet.getRow(29).getCell(3); cell.setCellValue(tbu);

} try (FileOutputStream outFile = new FileOutputStream(new File(aks7)) ) { workbook.write(outFile); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } private void ATMActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { try { String item; readzdyi ak1 = new readzdyi(); ak1.abc(); String aks7 = newpath.getText(); Workbook workbook; try (FileInputStream file = new FileInputStream(new File("F:/AKSHAYP AHUJA2.xls"))) { workbook = new HSSFWorkbook(file); HSSFSheet sheet = (HSSFSheet) workbook.getSheetAt(0); Cell cell = null; Font f = workbook.createFont();

f.setFontHeight((short) 20); // ExcelExtractor ex=new ExcelExtractor((HSSFWorkbook) workbook) ; sheet.autoSizeColumn(WIDTH); for (int i = 0; i < readzdyi.stu.size(); i++) { item = stu.get(i); //StringTokenizer st = new StringTokenizer(item," "); System.out.println(item); //ex.getText(item); cell = sheet.getRow(i + 9).getCell(1); cell.setCellType(Cell.CELL_TYPE_STRING); cell.setCellValue(item); } } try (FileOutputStream outFile = new FileOutputStream(new File(aks7)) ) { workbook.write(outFile); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }

} private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {

try { readzusi ak1 = new readzusi(); String aa = ak1.abc(); readnode ob1 = new readnode(); ob1.abcde(); readzqri ob2 = new readzqri(); ob2.abcdef(); readzqkb ob3 = new readzqkb(); ob3.abcdefg(); CharacterCounter qq = new CharacterCounter(); CharacterCounter qq1 = new CharacterCounter(); CharacterCounter qq2 = new CharacterCounter(); CharacterCounter qq3 = new CharacterCounter(); CharacterCounter qq4 = new CharacterCounter(); CharacterCounter qq5 = new CharacterCounter(); CharacterCounter qq6 = new CharacterCounter(); CharacterCounter qq7 = new CharacterCounter(); CharacterCounter qq8 = new CharacterCounter();

CharacterCounter qq9 = new CharacterCounter(); CharacterCounter qq10 = new CharacterCounter(); CharacterCounter qq11 = new CharacterCounter(); CharacterCounter qq12 = new CharacterCounter(); int MXU = qq.countOccurrences("MXU", aa); int cacu = qq1.countOccurrences("CACU", aa); int cm = qq2.countOccurrences("CM", aa); int isu = qq3.countOccurrences("ISU", aa); int omu = qq4.countOccurrences("OMU", aa); int vanu = qq5.countOccurrences("VANU", aa); int tcuu = qq6.countOccurrences("TCU", aa); int sfu = qq7.countOccurrences("SFU", aa); int ehu = qq8.countOccurrences("EHU", aa); int niwu = qq9.countOccurrences("NIWU", aa); int iws1 = qq10.countOccurrences("IWS1", aa); int npgep = qq11.countOccurrences("NPGEP", aa); int tbu = qq12.countOccurrences("TBU", aa); String sysdate = new SimpleDateFormat("dd-MM-yyyy").format(new Date( )); String atm = ATM.getText(); String aks00 = name.getText(); String aks7 = newpath.getText(); String aks8 = hw.getText(); HSSFWorkbook workbook; try ( FileInputStream file = new FileInputStream(new File("F:/REST 1.xls"))) { workbook = new HSSFWorkbook(file); HSSFSheet sheett = workbook.getSheetAt(0); HSSFSheet shee = workbook.getSheetAt(2); HSSFSheet sheet = workbook.getSheetAt(3); HSSFSheet sh = workbook.getSheetAt(9); HSSFSheet shu = workbook.getSheetAt(8); Cell cell = null; //cover cell = sheett.getRow(6).getCell(4); cell.setCellValue(ob1.readnodename); //version cell = shee.getRow(6).getCell(4); cell.setCellValue(aks00); cell = shee.getRow(6).getCell(3); cell.setCellValue(ob1.readdate); cell = shee.getRow(6).getCell(2); cell.setCellValue(sysdate); //node info cell = sheet.getRow(6).getCell(2); cell.setCellValue(atm); cell = sheet.getRow(15).getCell(3); cell.setCellValue(cacu);

cell = sheet.getRow(16).getCell(3); cell.setCellValue(cm); cell = sheet.getRow(17).getCell(3); cell.setCellValue(isu); cell = sheet.getRow(18).getCell(3); cell.setCellValue(omu); cell = sheet.getRow(19).getCell(3); cell.setCellValue(vanu); cell = sheet.getRow(20).getCell(3); cell.setCellValue(tcuu); cell = sheet.getRow(21).getCell(3); cell.setCellValue(MXU); cell = sheet.getRow(22).getCell(3); cell.setCellValue(sfu); cell = sheet.getRow(23).getCell(3); cell.setCellValue(ehu); cell = sheet.getRow(25).getCell(3); cell.setCellValue(niwu); cell = sheet.getRow(26).getCell(3); cell.setCellValue(iws1); cell = sheet.getRow(27).getCell(3); cell.setCellValue(npgep); cell = sheet.getRow(29).getCell(3); cell.setCellValue(tbu); cell = sheet.getRow(25).getCell(2); cell.setCellValue(aks8); //omand ip table cell = sh.getRow(4).getCell(4); cell.setCellValue(ob2.readomuip); cell = sh.getRow(5).getCell(4); cell.setCellValue(ob2.readomu0ip); cell = sh.getRow(6).getCell(4); cell.setCellValue(ob2.readomu1ip); cell = sh.getRow(4).getCell(3); cell.setCellValue(ob2.readomusubnet); cell = sh.getRow(5).getCell(3); cell.setCellValue(ob2.readomu0subnet); cell = sh.getRow(6).getCell(3); cell.setCellValue(ob2.readomu1subnet); cell = sh.getRow(4).getCell(6); cell.setCellValue(ob3.a); cell = sh.getRow(5).getCell(6); cell.setCellValue(ob3.a); cell = sh.getRow(6).getCell(6);

cell.setCellValue(ob3.a); ///fe and ge cell = shu.getRow(4).getCell(4); cell.setCellValue(ob2.readifge0); cell = shu.getRow(4).getCell(5); cell.setCellValue(ob2.readifge00); cell = shu.getRow(5).getCell(4); cell.setCellValue(ob2.readifge1); cell = shu.getRow(5).getCell(5); cell.setCellValue(ob2.readifge11); cell = shu.getRow(6).getCell(4); cell.setCellValue(ob2.readifge2); cell = shu.getRow(6).getCell(5); cell.setCellValue(ob2.readifge22); cell = shu.getRow(7).getCell(4); cell.setCellValue(ob2.readifge3); cell = shu.getRow(7).getCell(5); cell.setCellValue(ob2.readifge33); cell = shu.getRow(4).getCell(7); cell.setCellValue(ob3.d); cell = shu.getRow(5).getCell(7); cell.setCellValue(ob3.e); cell = shu.getRow(6).getCell(7); cell.setCellValue(ob3.f); cell = shu.getRow(7).getCell(7); cell.setCellValue(ob3.g); } try (FileOutputStream outFile = new FileOutputStream(new File(aks7)) ) { workbook.write(outFile); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }

// TODO add your handling code here: } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { try { readzqri ak = new readzqri(); ak.abcdef(); String aks7 = newpath.getText(); String abcd = ak.readomuip; HSSFWorkbook workbook; try (FileInputStream file = new FileInputStream(new File("F:/AKSHAYP

AHUJA.xls"))) { workbook = new HSSFWorkbook(file); HSSFSheet sh = workbook.getSheetAt(11); Cell cell = null; cell = sh.getRow(4).getCell(4); cell.setCellValue(abcd); cell = sh.getRow(5).getCell(4); cell.setCellValue(ak.readomu0ip); cell = sh.getRow(6).getCell(4); cell.setCellValue(ak.readomu1ip); cell = sh.getRow(4).getCell(3); cell.setCellValue(ak.readomusubnet); cell = sh.getRow(5).getCell(3); cell.setCellValue(ak.readomu0subnet); cell = sh.getRow(6).getCell(3); cell.setCellValue(ak.readomu1subnet); } try (FileOutputStream outFile = new FileOutputStream(new File(aks7)) ) { workbook.write(outFile); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } // TODO add your handling code here: } private void nodeActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } /** * @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 cod e (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the d efault look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lo okandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIMana ger.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(ui.class.getName()).log(java.util .logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(ui.class.getName()).log(java.util .logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(ui.class.getName()).log(java.util .logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(ui.class.getName()).log(java.util .logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { new ui().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JTextField ATM; private javax.swing.JButton cover; private javax.swing.JTextField hw; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; 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.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JTextField name; private javax.swing.JTextField newpath; private javax.swing.JTextField node; private javax.swing.JTextField path; private javax.swing.JButton userplane; private javax.swing.JButton version; // End of variables declaration }