TENZINLOBSANGg

java 3

May 25th, 2017
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 22.90 KB | None | 0 0
  1.  
  2. import com.panamahitek.ArduinoException;
  3. import com.panamahitek.PanamaHitek_Arduino;
  4. import java.awt.HeadlessException;
  5. import java.sql.Connection;
  6. import java.sql.DriverManager;
  7. import java.sql.SQLException;
  8. import java.sql.Statement;
  9. import java.util.logging.Level;
  10. import java.util.logging.Logger;
  11. import javax.swing.JOptionPane;
  12. import jssc.SerialPortEventListener;
  13. import jssc.SerialPortException;
  14.  
  15. /*
  16.  * To change this license header, choose License Headers in Project Properties.
  17.  * To change this template file, choose Tools | Templates
  18.  * and open the template in the editor.
  19.  */
  20.  
  21. /**
  22.  *
  23.  * @author tenzin lobsang
  24.  */
  25.  
  26. public class update_page extends javax.swing.JFrame {
  27.    int b=0;
  28. String ggg[]=new String[369];
  29.      PanamaHitek_Arduino ino = new PanamaHitek_Arduino();
  30.      
  31.      
  32.         private SerialPortEventListener listener = new SerialPortEventListener() {
  33.         @Override
  34.         public void serialEvent(jssc.SerialPortEvent spe) {
  35.            
  36.             try {
  37.                 if (ino.isMessageAvailable()) {
  38.                     System.out.println("i m tashi");
  39.                     ggg[b]=ino.printMessage();
  40.                     jTextArea1.append( ggg[b]+"\n");
  41.                    //jTextArea1.append( ino.receiveData()+"\n");
  42.                 b++;
  43.                 }
  44.             }
  45.             catch (SerialPortException | ArduinoException ex) {
  46.               // Logger.getLogger(JavaRX.class.getName()).log(Level.SEVERE, null, ex);
  47.             }
  48.         }
  49.     };
  50.      
  51. public update_page() {
  52.           this.pack();
  53.           try {
  54.             ino.arduinoRXTX("COM3", 115200, listener);
  55.            }
  56.           catch (ArduinoException ex) {
  57.             Logger.getLogger(JavaRXTX.class.getName()).log(Level.SEVERE, null, ex);
  58.            }
  59.        initComponents();
  60. }
  61.  
  62.  
  63.     @SuppressWarnings("unchecked")
  64.     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  65.     private void initComponents() {
  66.  
  67.         jButton1 = new javax.swing.JButton();
  68.         jButton2 = new javax.swing.JButton();
  69.         jButton3 = new javax.swing.JButton();
  70.         comboweek = new javax.swing.JComboBox<>();
  71.         combosub1 = new javax.swing.JComboBox<>();
  72.         combosub2 = new javax.swing.JComboBox<>();
  73.         combosub3 = new javax.swing.JComboBox<>();
  74.         combosub4 = new javax.swing.JComboBox<>();
  75.         combosub5 = new javax.swing.JComboBox<>();
  76.         combosub6 = new javax.swing.JComboBox<>();
  77.         combosub7 = new javax.swing.JComboBox<>();
  78.         jLabel1 = new javax.swing.JLabel();
  79.         jScrollPane1 = new javax.swing.JScrollPane();
  80.         jTable1 = new javax.swing.JTable();
  81.         jButton4 = new javax.swing.JButton();
  82.         jButton5 = new javax.swing.JButton();
  83.         jScrollPane2 = new javax.swing.JScrollPane();
  84.         jTextArea1 = new javax.swing.JTextArea();
  85.         jButton6 = new javax.swing.JButton();
  86.         jScrollPane3 = new javax.swing.JScrollPane();
  87.         jTextArea2 = new javax.swing.JTextArea();
  88.  
  89.         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  90.  
  91.         jButton1.setText("change subject");
  92.         jButton1.addActionListener(new java.awt.event.ActionListener() {
  93.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  94.                 jButton1ActionPerformed(evt);
  95.             }
  96.         });
  97.  
  98.         jButton2.setText("update attendance");
  99.         jButton2.addActionListener(new java.awt.event.ActionListener() {
  100.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  101.                 jButton2ActionPerformed(evt);
  102.             }
  103.         });
  104.  
  105.         jButton3.setText("Back");
  106.         jButton3.addActionListener(new java.awt.event.ActionListener() {
  107.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  108.                 jButton3ActionPerformed(evt);
  109.             }
  110.         });
  111.  
  112.         comboweek.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "WEEK", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", " ", " " }));
  113.  
  114.         combosub1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SUBJECT 1", "Math", "AE", "EMF", "DLD", "NT", "PTSP", "AE lap", "DLD lap" }));
  115.  
  116.         combosub2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SUBJECT 2", "Math", "AE", "EMF", "DLD", "NT", "PTSP", "AE lap", "DLD lap" }));
  117.         combosub2.addActionListener(new java.awt.event.ActionListener() {
  118.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  119.                 combosub2ActionPerformed(evt);
  120.             }
  121.         });
  122.  
  123.         combosub3.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SUBJECT 3", "Math", "AE", "EMF", "DLD", "NT", "PTSP", "AE lap", "DLD lap", "" }));
  124.  
  125.         combosub4.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SUBJECT 4", "Math", "AE", "EMF", "DLD", "NT", "PTSP", "AE lap", "DLD lap" }));
  126.         combosub4.addActionListener(new java.awt.event.ActionListener() {
  127.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  128.                 combosub4ActionPerformed(evt);
  129.             }
  130.         });
  131.  
  132.         combosub5.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SUBJECT 5", "Math", "AE", "EMF", "DLD", "NT", "PTSP", "AE lap", "DLD lap" }));
  133.  
  134.         combosub6.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SUBJECT 6", "Math", "AE", "EMF", "DLD", "NT", "PTSP", "AE lap", "DLD lap" }));
  135.  
  136.         combosub7.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "SUBJECT 7", "Math", "AE", "EMF", "DLD", "NT", "PTSP", "AE lap", "DLD lap" }));
  137.  
  138.         jLabel1.setText("SELECT THE WEEK AND IT'S RESPECTIVE CLASS HELD ON THAT PARDICULAR DAY");
  139.  
  140.         jTable1.setModel(new javax.swing.table.DefaultTableModel(
  141.             new Object [][] {
  142.                 {"2", "2", "3", null},
  143.                 {"32", "2", "2", "3"},
  144.                 {null, "12", "5", "2"},
  145.                 {"2", "332", "5", "3"}
  146.             },
  147.             new String [] {
  148.                 "Title 1", "Title 2", "Title 3", "Title 4"
  149.             }
  150.         ));
  151.         jScrollPane1.setViewportView(jTable1);
  152.  
  153.         jButton4.setText("jButton4");
  154.         jButton4.addActionListener(new java.awt.event.ActionListener() {
  155.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  156.                 jButton4ActionPerformed(evt);
  157.             }
  158.         });
  159.  
  160.         jButton5.setText("jButton5");
  161.         jButton5.addActionListener(new java.awt.event.ActionListener() {
  162.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  163.                 jButton5ActionPerformed(evt);
  164.             }
  165.         });
  166.  
  167.         jTextArea1.setColumns(20);
  168.         jTextArea1.setRows(5);
  169.         jScrollPane2.setViewportView(jTextArea1);
  170.  
  171.         jButton6.setText("jButton6");
  172.         jButton6.addActionListener(new java.awt.event.ActionListener() {
  173.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  174.                 jButton6ActionPerformed(evt);
  175.             }
  176.         });
  177.  
  178.         jTextArea2.setColumns(20);
  179.         jTextArea2.setRows(5);
  180.         jScrollPane3.setViewportView(jTextArea2);
  181.  
  182.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  183.         getContentPane().setLayout(layout);
  184.         layout.setHorizontalGroup(
  185.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  186.             .addGroup(layout.createSequentialGroup()
  187.                 .addGap(70, 70, 70)
  188.                 .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 878, javax.swing.GroupLayout.PREFERRED_SIZE))
  189.             .addGroup(layout.createSequentialGroup()
  190.                 .addGap(40, 40, 40)
  191.                 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 762, javax.swing.GroupLayout.PREFERRED_SIZE))
  192.             .addGroup(layout.createSequentialGroup()
  193.                 .addGap(31, 31, 31)
  194.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
  195.                     .addGroup(layout.createSequentialGroup()
  196.                         .addComponent(comboweek, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  197.                         .addGap(18, 18, 18)
  198.                         .addComponent(combosub1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  199.                         .addGap(18, 18, 18)
  200.                         .addComponent(combosub2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  201.                         .addGap(18, 18, 18)
  202.                         .addComponent(combosub3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  203.                         .addGap(18, 18, 18)
  204.                         .addComponent(combosub4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  205.                         .addGap(32, 32, 32)
  206.                         .addComponent(combosub5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  207.                         .addGap(13, 13, 13)
  208.                         .addComponent(combosub6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  209.                         .addGap(23, 23, 23)
  210.                         .addComponent(combosub7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  211.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  212.                         .addComponent(jButton6))
  213.                     .addGroup(layout.createSequentialGroup()
  214.                         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  215.                             .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
  216.                             .addComponent(jButton2)
  217.                             .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))
  218.                         .addGap(130, 130, 130)
  219.                         .addComponent(jButton4)
  220.                         .addGap(42, 42, 42)
  221.                         .addComponent(jButton5)
  222.                         .addGap(29, 29, 29)
  223.                         .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
  224.                         .addGap(18, 18, 18)
  225.                         .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
  226.                         .addGap(36, 36, 36))))
  227.         );
  228.         layout.setVerticalGroup(
  229.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  230.             .addGroup(layout.createSequentialGroup()
  231.                 .addGap(20, 20, 20)
  232.                 .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
  233.                 .addGap(14, 14, 14)
  234.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  235.                     .addComponent(combosub5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  236.                     .addComponent(combosub6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  237.                     .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  238.                         .addComponent(combosub7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  239.                         .addComponent(jButton6))
  240.                     .addGroup(layout.createSequentialGroup()
  241.                         .addGap(5, 5, 5)
  242.                         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  243.                             .addComponent(comboweek, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  244.                             .addComponent(combosub1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  245.                             .addComponent(combosub2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  246.                             .addComponent(combosub3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  247.                             .addComponent(combosub4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
  248.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  249.                     .addGroup(layout.createSequentialGroup()
  250.                         .addGap(64, 64, 64)
  251.                         .addComponent(jButton1)
  252.                         .addGap(11, 11, 11)
  253.                         .addComponent(jButton2)
  254.                         .addGap(10, 10, 10)
  255.                         .addComponent(jButton3))
  256.                     .addGroup(layout.createSequentialGroup()
  257.                         .addGap(107, 107, 107)
  258.                         .addComponent(jButton4))
  259.                     .addGroup(layout.createSequentialGroup()
  260.                         .addGap(107, 107, 107)
  261.                         .addComponent(jButton5))
  262.                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  263.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  264.                         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  265.                             .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
  266.                             .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))))
  267.                 .addGap(31, 31, 31)
  268.                 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
  269.         );
  270.  
  271.         pack();
  272.     }// </editor-fold>                        
  273. int mon[];
  274.    
  275.     private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  276. /*try{
  277. int c=0;
  278.     Class.forName("java.sql.Driver");
  279.     Connection con= DriverManager.getConnection("jdbc:mysql://localhost:3306/dsu","root","12345");
  280.     String log_qry="select id from timetable where id ='"+id+"';";
  281.     Statement stm=con.createStatement();
  282.     ResultSet rs=stm.executeQuery(log_qry);
  283.     if(rs.next()){
  284.     String pass_qry="select * from login where id ='"+id +"'and password ='"+password+"';";
  285.     rs=stm.executeQuery(pass_qry);
  286.     if(rs.next()){
  287.              update_page frame2 = new update_page();
  288.      frame2.setVisible(true);
  289.      c=1;
  290.     }
  291.     if (c==0)
  292.     JOptionPane.showMessageDialog(this, "incorrect password");
  293.     c++;
  294. }
  295.     if (c==0){
  296.          JOptionPane.showMessageDialog(this, "incorrect username");
  297.     }
  298.     }
  299. catch(Exception e){
  300.     JOptionPane.showMessageDialog(this, "Error:in login function");
  301. }*/
  302.  
  303.  
  304. //int row = timetable1.getRowCount();
  305. //int col = timetable1.getColumnCount();
  306.  
  307.  
  308.  
  309.  
  310.    
  311.   /* try{
  312.   PreparedStatement statement;
  313.    Connection com ;
  314.       int c = 0;
  315.        Class.forName("com.mysql.jdbc.Driver");
  316.        com = DriverManager.getConnection("jdbc:mysql://localhost:3306/dsu","root","12345");
  317.        statement = com.prepareStatement("insert into timetable values(?, ?, ?, ?, ?, ?, ?, ?");
  318.      for(int i=1;i<=row;i++)
  319. {
  320.     for(int j = 2;j<=col;j++){
  321.         String tablevalue= (String) timetable1.getValueAt(1, j);
  322.           for(int k = 0;k<=(col-1);k++)
  323.        {
  324.        statement.setString(k,tablevalue);
  325.         c+=1;
  326.        }
  327.          
  328.          
  329.           c = statement.executeUpdate();
  330.          
  331.     }
  332. }
  333.    if(c>=1){
  334.          JOptionPane.showMessageDialog(this,"sub updated");
  335.      }
  336.          
  337.    }*/
  338.  
  339. String week = comboweek.getSelectedItem().toString();
  340. String sub1 = combosub1.getSelectedItem().toString();
  341. String sub2 = combosub2.getSelectedItem().toString();
  342. String sub3 = comboweek.getSelectedItem().toString();
  343. String sub4 = comboweek.getSelectedItem().toString();
  344. String sub5 = comboweek.getSelectedItem().toString();
  345. String sub6 = comboweek.getSelectedItem().toString();
  346. String sub7 = combosub7.getSelectedItem().toString();
  347.  
  348.   try
  349.   {
  350.       Class.forName("java.sql.DriverManager");
  351.       Connection con = (Connection)   DriverManager.getConnection ("jdbc:mysql://localhost:3306/dsu","root", "12345");
  352.       Statement stmt = (Statement) con.createStatement();
  353.       if(comboweek.getSelectedIndex()!= 0){
  354.       String query="INSERT INTO timetable VALUES ('"+week+"','"+sub1+"','"+sub2+"','"+sub3+"','"+sub4+"','"+sub5+"','"+sub6+"','"+sub7+"');";
  355.       stmt.executeUpdate(query);
  356.         JOptionPane.showMessageDialog(this,"subject updated");
  357.   }
  358.   }
  359.  
  360.  
  361.    
  362.    catch(HeadlessException e)
  363.    {
  364.        JOptionPane.showMessageDialog(this," error head = sub not updated");
  365.    }
  366.    catch(ClassNotFoundException e)
  367.            {
  368.             JOptionPane.showMessageDialog(this," error class = sub not updated");
  369.            }
  370.    catch(SQLException e)
  371.    {
  372.         JOptionPane.showMessageDialog(this," error SQL = sub not updated");
  373.    }
  374.   if(comboweek.getSelectedIndex()== 0)
  375.   {
  376.       JOptionPane.showMessageDialog(this,"please select the week ");
  377.   }
  378.  
  379.  
  380.  
  381. // TODO add your handling code here:
  382.     }                                        
  383.  
  384.     private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  385. this.dispose();
  386. LOGIN frame2 = new LOGIN();
  387. frame2.setVisible(true);
  388.  
  389.     }                                        
  390.  
  391.     private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  392. try{
  393.     ino.sendData("2");
  394. }
  395. catch(Exception ex){
  396.     Logger.getLogger(update_page.class.getName()).log(Level.SEVERE,null, ex);
  397. }
  398. System.out.println("arduino to java");
  399.        
  400.     }                                        
  401.  
  402.     private void combosub2ActionPerformed(java.awt.event.ActionEvent evt) {                                          
  403.         // TODO add your handling code here:
  404.     }                                        
  405.  
  406.     private void combosub4ActionPerformed(java.awt.event.ActionEvent evt) {                                          
  407.         // TODO add your handling code here:
  408.     }                                        
  409.  
  410.     private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  411. try{
  412.     ino.sendData("0");
  413. }
  414. catch(Exception ex){
  415.     Logger.getLogger(update_page.class.getName()).log(Level.SEVERE,null, ex);
  416. }
  417. System.out.println("led is off");
  418.          
  419.     }                                        
  420.  
  421.     private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  422. try{
  423.     ino.sendData("1");
  424. }
  425. catch(Exception ex){
  426.     Logger.getLogger(update_page.class.getName()).log(Level.SEVERE,null, ex);
  427. }
  428. System.out.println("led is on");
  429.  
  430.     }                                        
  431.  
  432.     private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  433. for(int i=0;i<b;i++){
  434.     jTextArea2.append(ggg[i]+"\n");
  435. }
  436.  
  437.     }                                        
  438.  
  439.     /**
  440.      * @param args the command line arguments
  441.      */
  442.     public static void main(String args[]) {
  443.         /* Set the Nimbus look and feel */
  444.         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  445.         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  446.          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  447.          */
  448.         try {
  449.             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  450.                 if ("Nimbus".equals(info.getName())) {
  451.                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
  452.                     break;
  453.                 }
  454.             }
  455.         } catch (ClassNotFoundException ex) {
  456.             java.util.logging.Logger.getLogger(update_page.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  457.         } catch (InstantiationException ex) {
  458.             java.util.logging.Logger.getLogger(update_page.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  459.         } catch (IllegalAccessException ex) {
  460.             java.util.logging.Logger.getLogger(update_page.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  461.         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  462.             java.util.logging.Logger.getLogger(update_page.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  463.         }
  464.         //</editor-fold>
  465.  
  466.         /* Create and display the form */
  467.         java.awt.EventQueue.invokeLater(new Runnable() {
  468.             public void run() {
  469.                 new update_page().setVisible(true);
  470.                
  471.             }
  472.         });
  473.     }
  474.  
  475.     // Variables declaration - do not modify                    
  476.     private javax.swing.JComboBox<String> combosub1;
  477.     private javax.swing.JComboBox<String> combosub2;
  478.     private javax.swing.JComboBox<String> combosub3;
  479.     private javax.swing.JComboBox<String> combosub4;
  480.     private javax.swing.JComboBox<String> combosub5;
  481.     private javax.swing.JComboBox<String> combosub6;
  482.     private javax.swing.JComboBox<String> combosub7;
  483.     private javax.swing.JComboBox<String> comboweek;
  484.     private javax.swing.JButton jButton1;
  485.     private javax.swing.JButton jButton2;
  486.     private javax.swing.JButton jButton3;
  487.     private javax.swing.JButton jButton4;
  488.     private javax.swing.JButton jButton5;
  489.     private javax.swing.JButton jButton6;
  490.     private javax.swing.JLabel jLabel1;
  491.     private javax.swing.JScrollPane jScrollPane1;
  492.     private javax.swing.JScrollPane jScrollPane2;
  493.     private javax.swing.JScrollPane jScrollPane3;
  494.     private javax.swing.JTable jTable1;
  495.     private javax.swing.JTextArea jTextArea1;
  496.     private javax.swing.JTextArea jTextArea2;
  497.     // End of variables declaration                  
  498. }
Add Comment
Please, Sign In to add comment