Advertisement
Guest User

Untitled

a guest
Oct 24th, 2017
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.57 KB | None | 0 0
  1. import com.itextpdf.text.Document;
  2. import com.itextpdf.text.pdf.PdfPTable;
  3. import com.itextpdf.text.pdf.PdfWriter;
  4. import java.io.FileOutputStream;
  5. import java.sql.SQLException;
  6. import java.text.MessageFormat;
  7. import java.util.logging.Level;
  8. import java.util.logging.Logger;
  9. import javax.swing.JOptionPane;
  10. import javax.swing.JTable;
  11. import javax.swing.table.DefaultTableModel;
  12.  
  13. public class frmStart extends javax.swing.JFrame {
  14.  
  15. // DefaultTableModel dm;
  16.  
  17. conn cn = new conn();
  18.  
  19. String url = "jdbc:firebirdsql://localhost:3050/C:\\PHONEBOOKFINAL.FDB";
  20. String driver = "org.firebirdsql.jdbc.FBDriver";
  21. String user = "SYSDBA";
  22. String password = "masterkey";
  23. DefaultTableModel list = new DefaultTableModel();
  24.  
  25. public void AssembleList(){
  26.  
  27. if(!"".equals(txtSearch.getText())){
  28. list.setColumnCount(0);
  29. list.setRowCount(0);
  30. cn.connect(url,driver,user,password);
  31.  
  32. String sql = " SELECT * FROM contact"
  33. + " WHERE name"
  34. + " LIKE '%"+txtSearch.getText().toUpperCase()+"%' OR tel"
  35. + " LIKE '%"+txtSearch.getText()+"%'"
  36. + " ORDER BY name";
  37.  
  38. cn.executeQuery(sql);
  39.  
  40. list.addColumn("ID");
  41. list.addColumn("Name");
  42. list.addColumn("Telephone");
  43.  
  44. try{
  45. while(cn.rs.next()){
  46. list.addRow(new String[]{cn.rs.getString("ID"), cn.rs.getString("name"),cn.rs.getString("tel")});
  47.  
  48. }
  49.  
  50. } catch(SQLException ex){
  51. JOptionPane.showMessageDialog(null,"Error " + ex);
  52. }
  53. cn.disconnect();
  54. jTable1.setModel(list);
  55. }
  56. else{
  57. list.setColumnCount(0);
  58. list.setRowCount(0);
  59. jTable1.setModel(list);
  60. }
  61. }
  62. public void disAllList(){
  63.  
  64.  
  65. list.setColumnCount(0);
  66. list.setRowCount(0);
  67. cn.connect(url,driver,user,password);
  68.  
  69. String sql = " SELECT * FROM contact ORDER BY id";
  70.  
  71. cn.executeQuery(sql);
  72.  
  73. list.addColumn("ID");
  74. list.addColumn("Name");
  75. list.addColumn("Telephone");
  76.  
  77. try{
  78. while(cn.rs.next()){
  79. list.addRow(new String[]{cn.rs.getString("ID"), cn.rs.getString("name"),cn.rs.getString("tel")});
  80.  
  81. }
  82.  
  83. } catch(SQLException ex){
  84. JOptionPane.showMessageDialog(null,"Error " + ex);
  85. }
  86. cn.disconnect();
  87. jTable1.setModel(list);
  88.  
  89. }
  90. public void Select(){
  91.  
  92. int line = jTable1.getSelectedRow();
  93. txtID.setText(jTable1.getValueAt(line,0).toString());
  94. txtName.setText(jTable1.getValueAt(line,1).toString());
  95. txtTele.setText(jTable1.getValueAt(line,2).toString());
  96.  
  97. }
  98.  
  99. @SuppressWarnings("unchecked")
  100.  
  101. public frmStart() {
  102. initComponents();
  103.  
  104. // CreateColumns();
  105. }
  106.  
  107. // private void CreateColumns(){
  108. //
  109. // dm=(DefaultTableModel) jTable1.getModel();
  110. //
  111. // dm.addColumn("Name");
  112. // dm.addColumn("Telephone");
  113. //
  114. // }
  115. // private void Populate(String name, String tele){
  116. // String[] rowData={name,tele};
  117. // dm.addRow(rowData);
  118. // }
  119.  
  120. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  121. private void initComponents() {
  122.  
  123. jScrollPane1 = new javax.swing.JScrollPane();
  124. jTable1 = new javax.swing.JTable();
  125. jLabel1 = new javax.swing.JLabel();
  126. jLabel2 = new javax.swing.JLabel();
  127. jLabel3 = new javax.swing.JLabel();
  128. jLabel4 = new javax.swing.JLabel();
  129. txtSearch = new javax.swing.JTextField();
  130. txtID = new javax.swing.JTextField();
  131. txtName = new javax.swing.JTextField();
  132. txtTele = new javax.swing.JTextField();
  133. btnRegister = new javax.swing.JButton();
  134. btnDelete = new javax.swing.JButton();
  135. btnEditName = new javax.swing.JButton();
  136. btnCancelName = new javax.swing.JButton();
  137. btnSaveName = new javax.swing.JButton();
  138. btnEditTele = new javax.swing.JButton();
  139. btnCancelTele = new javax.swing.JButton();
  140. btnSaveTele = new javax.swing.JButton();
  141. btnDispAll = new javax.swing.JButton();
  142. jButton1 = new javax.swing.JButton();
  143. jButton_pdf = new javax.swing.JButton();
  144.  
  145. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  146. addWindowListener(new java.awt.event.WindowAdapter() {
  147. public void windowOpened(java.awt.event.WindowEvent evt) {
  148. formWindowOpened(evt);
  149. }
  150. });
  151.  
  152. jTable1.setModel(new javax.swing.table.DefaultTableModel(
  153. new Object [][] {
  154.  
  155. },
  156. new String [] {
  157.  
  158. }
  159. ));
  160. jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
  161. public void mouseClicked(java.awt.event.MouseEvent evt) {
  162. jTable1MouseClicked(evt);
  163. }
  164. });
  165. jTable1.addKeyListener(new java.awt.event.KeyAdapter() {
  166. public void keyReleased(java.awt.event.KeyEvent evt) {
  167. jTable1KeyReleased(evt);
  168. }
  169. });
  170. jScrollPane1.setViewportView(jTable1);
  171.  
  172. jLabel1.setText("Search");
  173.  
  174. jLabel2.setText("ID");
  175.  
  176. jLabel3.setText("Name");
  177.  
  178. jLabel4.setText("Telephone");
  179.  
  180. txtSearch.addActionListener(new java.awt.event.ActionListener() {
  181. public void actionPerformed(java.awt.event.ActionEvent evt) {
  182. txtSearchActionPerformed(evt);
  183. }
  184. });
  185. txtSearch.addKeyListener(new java.awt.event.KeyAdapter() {
  186. public void keyReleased(java.awt.event.KeyEvent evt) {
  187. txtSearchKeyReleased(evt);
  188. }
  189. });
  190.  
  191. txtID.setEnabled(false);
  192.  
  193. txtName.setEnabled(false);
  194. txtName.addActionListener(new java.awt.event.ActionListener() {
  195. public void actionPerformed(java.awt.event.ActionEvent evt) {
  196. txtNameActionPerformed(evt);
  197. }
  198. });
  199.  
  200. txtTele.setEnabled(false);
  201.  
  202. btnRegister.setText("Go To USER REGISTRATION");
  203. btnRegister.addActionListener(new java.awt.event.ActionListener() {
  204. public void actionPerformed(java.awt.event.ActionEvent evt) {
  205. btnRegisterActionPerformed(evt);
  206. }
  207. });
  208.  
  209. btnDelete.setText("Delete");
  210. btnDelete.addActionListener(new java.awt.event.ActionListener() {
  211. public void actionPerformed(java.awt.event.ActionEvent evt) {
  212. btnDeleteActionPerformed(evt);
  213. }
  214. });
  215.  
  216. btnEditName.setText("Edit");
  217. btnEditName.setToolTipText("");
  218. btnEditName.addActionListener(new java.awt.event.ActionListener() {
  219. public void actionPerformed(java.awt.event.ActionEvent evt) {
  220. btnEditNameActionPerformed(evt);
  221. }
  222. });
  223.  
  224. btnCancelName.setText("Cancel");
  225. btnCancelName.setEnabled(false);
  226. btnCancelName.addActionListener(new java.awt.event.ActionListener() {
  227. public void actionPerformed(java.awt.event.ActionEvent evt) {
  228. btnCancelNameActionPerformed(evt);
  229. }
  230. });
  231.  
  232. btnSaveName.setText("Save");
  233. btnSaveName.setEnabled(false);
  234. btnSaveName.addActionListener(new java.awt.event.ActionListener() {
  235. public void actionPerformed(java.awt.event.ActionEvent evt) {
  236. btnSaveNameActionPerformed(evt);
  237. }
  238. });
  239.  
  240. btnEditTele.setText("Edit");
  241. btnEditTele.addActionListener(new java.awt.event.ActionListener() {
  242. public void actionPerformed(java.awt.event.ActionEvent evt) {
  243. btnEditTeleActionPerformed(evt);
  244. }
  245. });
  246.  
  247. btnCancelTele.setText("Cancel");
  248. btnCancelTele.setEnabled(false);
  249. btnCancelTele.addActionListener(new java.awt.event.ActionListener() {
  250. public void actionPerformed(java.awt.event.ActionEvent evt) {
  251. btnCancelTeleActionPerformed(evt);
  252. }
  253. });
  254.  
  255. btnSaveTele.setText("Save");
  256. btnSaveTele.setEnabled(false);
  257. btnSaveTele.addActionListener(new java.awt.event.ActionListener() {
  258. public void actionPerformed(java.awt.event.ActionEvent evt) {
  259. btnSaveTeleActionPerformed(evt);
  260. }
  261. });
  262.  
  263. btnDispAll.setText("Display All");
  264. btnDispAll.addActionListener(new java.awt.event.ActionListener() {
  265. public void actionPerformed(java.awt.event.ActionEvent evt) {
  266. btnDispAllActionPerformed(evt);
  267. }
  268. });
  269.  
  270. jButton1.setText("Direct Print");
  271. jButton1.addActionListener(new java.awt.event.ActionListener() {
  272. public void actionPerformed(java.awt.event.ActionEvent evt) {
  273. jButton1ActionPerformed(evt);
  274. }
  275. });
  276.  
  277. jButton_pdf.setText("Generate Report ");
  278. jButton_pdf.addActionListener(new java.awt.event.ActionListener() {
  279. public void actionPerformed(java.awt.event.ActionEvent evt) {
  280. jButton_pdfActionPerformed(evt);
  281. }
  282. });
  283.  
  284. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  285. getContentPane().setLayout(layout);
  286. layout.setHorizontalGroup(
  287. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  288. .addGroup(layout.createSequentialGroup()
  289. .addGap(32, 32, 32)
  290. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  291. .addGroup(layout.createSequentialGroup()
  292. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  293. .addComponent(jLabel3)
  294. .addComponent(jLabel2)
  295. .addComponent(jLabel1))
  296. .addGap(25, 25, 25)
  297. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  298. .addComponent(txtID, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 342, Short.MAX_VALUE)
  299. .addComponent(txtName, javax.swing.GroupLayout.Alignment.TRAILING)
  300. .addGroup(layout.createSequentialGroup()
  301. .addComponent(txtSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)
  302. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  303. .addComponent(btnDispAll)
  304. .addGap(33, 33, 33))))
  305. .addGroup(layout.createSequentialGroup()
  306. .addComponent(jLabel4)
  307. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  308. .addComponent(txtTele, javax.swing.GroupLayout.DEFAULT_SIZE, 335, Short.MAX_VALUE)))
  309. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)
  310. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  311. .addGroup(layout.createSequentialGroup()
  312. .addComponent(btnEditTele)
  313. .addGap(6, 6, 6)
  314. .addComponent(btnCancelTele)
  315. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  316. .addComponent(btnSaveTele))
  317. .addGroup(layout.createSequentialGroup()
  318. .addComponent(btnEditName)
  319. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  320. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  321. .addComponent(btnDelete)
  322. .addGroup(layout.createSequentialGroup()
  323. .addComponent(btnCancelName)
  324. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  325. .addComponent(btnSaveName))))
  326. .addComponent(btnRegister, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE))
  327. .addGap(21, 21, 21))
  328. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  329. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  330. .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  331. .addGap(122, 122, 122))
  332. .addGroup(layout.createSequentialGroup()
  333. .addGap(230, 230, 230)
  334. .addComponent(jButton1)
  335. .addGap(18, 18, 18)
  336. .addComponent(jButton_pdf)
  337. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  338. );
  339. layout.setVerticalGroup(
  340. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  341. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  342. .addGap(32, 32, 32)
  343. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  344. .addComponent(jLabel1)
  345. .addComponent(txtSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  346. .addComponent(btnRegister)
  347. .addComponent(btnDispAll))
  348. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  349. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  350. .addComponent(jLabel2)
  351. .addComponent(txtID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  352. .addComponent(btnDelete))
  353. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  354. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  355. .addComponent(jLabel3)
  356. .addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  357. .addComponent(btnEditName)
  358. .addComponent(btnCancelName)
  359. .addComponent(btnSaveName))
  360. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  361. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  362. .addComponent(jLabel4)
  363. .addComponent(txtTele, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  364. .addComponent(btnEditTele)
  365. .addComponent(btnCancelTele)
  366. .addComponent(btnSaveTele))
  367. .addGap(45, 45, 45)
  368. .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
  369. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  370. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  371. .addComponent(jButton_pdf, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
  372. .addComponent(jButton1))
  373. .addContainerGap(34, Short.MAX_VALUE))
  374. );
  375.  
  376. pack();
  377. }// </editor-fold>
  378.  
  379. private void txtSearchActionPerformed(java.awt.event.ActionEvent evt) {
  380. frmRegister form = new frmRegister();
  381. form.setVisible(true);
  382. this.setVisible(false);
  383. }
  384.  
  385. private void txtSearchKeyReleased(java.awt.event.KeyEvent evt) {
  386. AssembleList();
  387.  
  388. }
  389.  
  390. private void jTable1KeyReleased(java.awt.event.KeyEvent evt) {
  391. Select();
  392.  
  393.  
  394. }
  395.  
  396. private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {
  397. Select();
  398. }
  399.  
  400. private void btnSaveNameActionPerformed(java.awt.event.ActionEvent evt) {
  401. cn.connect(url,driver,user,password);
  402. String sql = " update contact "
  403. + " SET name = '" + txtName.getText()
  404. + "' WHERE ID = " + Integer.parseInt(txtID.getText());
  405. cn.executeUpdate(sql);
  406. cn.disconnect();
  407. txtName.setEnabled(false);
  408. btnEditName.setEnabled(true);
  409. btnSaveName.setEnabled(false);
  410. btnCancelName.setEnabled(false);
  411. disAllList();
  412.  
  413.  
  414. }
  415.  
  416. private void btnEditNameActionPerformed(java.awt.event.ActionEvent evt) {
  417. txtName.setEnabled(true);
  418. btnSaveName.setEnabled(true);
  419. btnEditName.setEnabled(true);
  420. btnCancelName.setEnabled(true);
  421.  
  422.  
  423. }
  424.  
  425. private void btnSaveTeleActionPerformed(java.awt.event.ActionEvent evt) {
  426. cn.connect(url,driver,user,password);
  427. String sql = " UPDATE contact "
  428. + " SET tel = '" + txtTele.getText()
  429. + "' Where id = " + Integer.parseInt(txtID.getText());
  430. cn.executeUpdate(sql);
  431. cn.disconnect();
  432. txtTele.setEnabled(false);
  433. btnEditTele.setEnabled(true);
  434. btnSaveTele.setEnabled(false);
  435. btnCancelTele.setEnabled(false);
  436. disAllList();
  437.  
  438. }
  439.  
  440. private void btnEditTeleActionPerformed(java.awt.event.ActionEvent evt) {
  441. txtTele.setEnabled(true);
  442. btnSaveTele.setEnabled(true);
  443. btnEditTele.setEnabled(true);
  444. btnCancelTele.setEnabled(true);
  445.  
  446. }
  447.  
  448. private void btnCancelTeleActionPerformed(java.awt.event.ActionEvent evt) {
  449. txtTele.setEnabled(false);
  450. btnSaveTele.setEnabled(false);
  451. btnCancelTele.setEnabled(false);
  452. btnEditTele.setEnabled(true);
  453. disAllList();
  454.  
  455. }
  456.  
  457. private void btnCancelNameActionPerformed(java.awt.event.ActionEvent evt) {
  458. txtName.setEnabled(false);
  459. btnSaveName.setEnabled(false);
  460. btnCancelName.setEnabled(false);
  461. btnEditName.setEnabled(true);
  462. disAllList();
  463. }
  464.  
  465. private void formWindowOpened(java.awt.event.WindowEvent evt) {
  466. this.setTitle("PhoneBook Database");
  467. }
  468.  
  469. private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {
  470. cn.connect(url,driver,user,password);
  471. String sql;
  472.  
  473. int resp=JOptionPane.showConfirmDialog(null,"Confirm Deletion of ID?");
  474.  
  475. if(resp==JOptionPane.YES_OPTION){
  476.  
  477. sql= "DELETE FROM contact "
  478. + " WHERE id = " + Integer.parseInt(txtID.getText());
  479. JOptionPane.showMessageDialog(null,"Successfully Deleted!");
  480. cn.executeUpdate(sql);
  481. cn.disconnect();
  482. txtName.setEnabled(false);
  483. btnEditName.setEnabled(true);
  484. btnSaveName.setEnabled(false);
  485. btnCancelName.setEnabled(false);
  486. btnSaveTele.setEnabled(false);
  487. btnCancelTele.setEnabled(false);
  488. txtSearch.setText("");
  489. txtID.setText("");
  490. txtName.setText("");
  491. txtTele.setText("");
  492. disAllList();
  493. }
  494. }
  495.  
  496. private void btnRegisterActionPerformed(java.awt.event.ActionEvent evt) {
  497. this.setVisible(false);
  498.  
  499. frmRegister form = new frmRegister();
  500.  
  501. form.setVisible(true);
  502. }
  503.  
  504. private void btnDispAllActionPerformed(java.awt.event.ActionEvent evt) {
  505.  
  506. disAllList();
  507.  
  508. }
  509.  
  510. private void txtNameActionPerformed(java.awt.event.ActionEvent evt) {
  511. // TODO add your handling code here:
  512. }
  513.  
  514. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
  515.  
  516.  
  517. try{
  518. MessageFormat header = new MessageFormat ("Report Print");
  519. MessageFormat footer = new MessageFormat ("page{1,number,integer}");
  520. jTable1.print(JTable.PrintMode.FIT_WIDTH,header,footer);
  521.  
  522. }catch(Exception e){
  523.  
  524. JOptionPane.showMessageDialog(null,e);
  525.  
  526. }
  527. }
  528.  
  529. private void jButton_pdfActionPerformed(java.awt.event.ActionEvent evt) {
  530.  
  531. try{
  532. Document doc = new Document();
  533. PdfWriter.getInstance(doc, new FileOutputStream("Contact_Report.PDF"));
  534. doc.open();
  535. PdfPTable pdfTable = new PdfPTable(jTable1.getColumnCount());
  536. for (int i =0 ; i < jTable1.getColumnCount();i++){
  537. pdfTable.addCell(jTable1.getColumnName(i));
  538. }
  539. for(int rows=0; rows < jTable1.getRowCount()-1; rows++){
  540. for(int cols =0; cols< jTable1.getColumnCount(); cols++){
  541. pdfTable.addCell(jTable1.getModel().getValueAt(rows,cols).toString());
  542. }
  543. }
  544. doc.add(pdfTable);
  545. doc.close();
  546. System.out.println("Report Successfully Generated");
  547. JOptionPane.showMessageDialog(null, "Report Successfully Generated at path C:\\Users\\Adrian\\Documents\\NetBeansProjects\\UNIVERSITY");
  548.  
  549. } catch (Exception e){
  550. JOptionPane.showMessageDialog(null, "An error occured");
  551. }
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561. }
  562.  
  563. /**
  564. * @param args the command line arguments
  565. */
  566. public static void main(String args[]) {
  567. /* Set the Nimbus look and feel */
  568. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  569. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  570. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  571. */
  572. try {
  573. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  574. if ("Nimbus".equals(info.getName())) {
  575. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  576. break;
  577. }
  578. }
  579. } catch (ClassNotFoundException ex) {
  580. java.util.logging.Logger.getLogger(frmStart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  581. } catch (InstantiationException ex) {
  582. java.util.logging.Logger.getLogger(frmStart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  583. } catch (IllegalAccessException ex) {
  584. java.util.logging.Logger.getLogger(frmStart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  585. } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  586. java.util.logging.Logger.getLogger(frmStart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  587. }
  588. //</editor-fold>
  589.  
  590. /* Create and display the form */
  591. java.awt.EventQueue.invokeLater(new Runnable() {
  592. public void run() {
  593. new frmStart().setVisible(true);
  594. }
  595. });
  596. }
  597.  
  598. // Variables declaration - do not modify
  599. private javax.swing.JButton btnCancelName;
  600. private javax.swing.JButton btnCancelTele;
  601. private javax.swing.JButton btnDelete;
  602. private javax.swing.JButton btnDispAll;
  603. private javax.swing.JButton btnEditName;
  604. private javax.swing.JButton btnEditTele;
  605. private javax.swing.JButton btnRegister;
  606. private javax.swing.JButton btnSaveName;
  607. private javax.swing.JButton btnSaveTele;
  608. private javax.swing.JButton jButton1;
  609. private javax.swing.JButton jButton_pdf;
  610. private javax.swing.JLabel jLabel1;
  611. private javax.swing.JLabel jLabel2;
  612. private javax.swing.JLabel jLabel3;
  613. private javax.swing.JLabel jLabel4;
  614. private javax.swing.JScrollPane jScrollPane1;
  615. private javax.swing.JTable jTable1;
  616. private javax.swing.JTextField txtID;
  617. private javax.swing.JTextField txtName;
  618. private javax.swing.JTextField txtSearch;
  619. private javax.swing.JTextField txtTele;
  620. // End of variables declaration
  621. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement