C:\Users\Man\Desktop\IA_FinaL_Submission_000307-0092\Product\IA_Netbeans_Project\src\ia\man\Main.java
  1 /*
  2  * To change this license header, choose License Headers in Project Properties.
  3  * To change this template file, choose Tools | Templates
  4  * and open the template in the editor.
  5  */
  6 package ia.man;
  7 
  8 
  9 import chrriis.common.UIUtils;
 10 import chrriis.dj.nativeswing.swtimpl.NativeInterface;
 11 import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser;
 12 
 13 import java.awt.Color;
 14 import java.awt.Container;
 15 import java.awt.Dimension;
 16 import java.awt.Toolkit;
 17 import java.awt.event.WindowAdapter;
 18 import java.awt.event.WindowEvent;
 19 import java.awt.BorderLayout;
 20 import java.awt.FlowLayout;
 21 import java.awt.event.ItemEvent;
 22 import java.awt.event.ItemListener;
 23 import java.io.BufferedReader;
 24 import java.io.BufferedWriter;
 25 import java.io.File;
 26 import java.io.FileReader;
 27 import java.io.FileWriter;
 28 import java.io.IOException;
 29 import java.net.MalformedURLException;
 30 import java.net.URL;
 31 import java.text.DateFormat;
 32 import java.text.SimpleDateFormat;
 33 import java.util.Date;
 34 import java.util.logging.Level;
 35 import java.util.logging.Logger;
 36 import javax.swing.BorderFactory;
 37 import javax.swing.JOptionPane;
 38 import javax.swing.table.DefaultTableModel;
 39 import javafx.application.Platform;
 40 import javafx.embed.swing.JFXPanel;
 41 import javafx.scene.Group;
 42 import javafx.scene.Scene;
 43 import javafx.scene.text.Font;
 44 import javafx.scene.text.Text;
 45 import javafx.scene.web.WebEngine;
 46 import javafx.scene.web.WebView;
 47 import javax.swing.JCheckBox;
 48 import javax.swing.JComponent;
 49 import javax.swing.JFrame;
 50 import javax.swing.JPanel;
 51 import javax.swing.WindowConstants;
 52 import javax.swing.JTextPane;
 53 import javax.swing.SwingUtilities;
 54 
 55 /**
 56  *
 57  * @author 14868
 58  */
 59 public class Main extends javax.swing.JFrame {
 60 
 61     /**
 62      * Creates new form Main
 63      */
 64   
 65     User iUser = new User();
 66 
 67     Main() {
 68         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
 69     }
 70     
 71     public Main(String id,String user,String email,String pass) throws IOException {
 72                 
 73         initComponents();
 74         panel1.add(createContent());
 75         
 76         iUser.AssingValue(id, user, email, pass);
 77         
 78         Toolkit toolkit = getToolkit();
 79         Dimension size = toolkit.getScreenSize();
 80         setLocation(size.width/2 - getWidth()/2, size.height/2 - getHeight()/2);
 81         
 82         DateFormat dateFormat = new SimpleDateFormat("MM-dd");
 83         DateFormat yearFormat = new SimpleDateFormat("yyyy");
 84         Date date = new Date();
 85         
 86         String year = yearFormat.format(date);
 87         int bc_year = Integer.parseInt(year) - 543;
 88          
 89         String Current_Date = String.valueOf(bc_year) + "-" + dateFormat.format(date); 
 90         
 91         lblDate.setText(Current_Date);
 92         
 93         setTitle(user);
 94         getInfo(id,user,email,pass);
 95         
 96         
 97         new Thread(() -> 
 98         {
 99            while(true)
100            {
101             checkReady(lblDate.getText());
102             try {
103                 Thread.sleep(500);
104             } catch (InterruptedException ex) {
105                 Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
106             }
107            }
108         }).start();
109 
110     }
111 
112  
385         
386         String id,user,email,pass;
387         
388         id = iUser.getID();
389         user = iUser.getUser();
390         email = iUser.getEmail();
391         pass = iUser.getPass();
392         
393         Planner planner = new Planner(id,user,email,pass);
394         planner.setVisible(true);
395         
396     }                                     
397 
398     /**
399      * @param args the command line arguments
400      */
401     public static void main(String args[]) {
402         /* Set the Nimbus look and feel */
403         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
404         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
405          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
406          */
407         try {
408             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
409                 if ("Nimbus".equals(info.getName())) {
410                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
411                     break;
412                 }
413             }
414         } catch (ClassNotFoundException ex) {
415             java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
416         } catch (InstantiationException ex) {
417             java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
418         } catch (IllegalAccessException ex) {
419             java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
420         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
421             java.util.logging.Logger.getLogger(Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
422         }
423         //</editor-fold>
424         //</editor-fold>
425         NativeInterface.open();
426         UIUtils.setPreferredLookAndFeel();
427         /* Create and display the form */
428         //java.awt.EventQueue.invokeLater(new Runnable() {
429         SwingUtilities.invokeLater(new Runnable() {
430             public void run() {
431                 new Main().setVisible(true);
432                 
433 //                JFrame frame = new JFrame("DJ Native Swing Test");
434 //                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
435 //                frame.getContentPane().add(createContent(), BorderLayout.CENTER);
436 //                frame.setSize(800, 600);
437 //                frame.setLocationByPlatform(true);
438 //                frame.setVisible(true);
439                 
440             }
441         });
442         NativeInterface.runEventPump();
443     }
444     
445     public void setTitle(String name)
446     {
447         String title = null;
448         SimpleDateFormat dateFormat = new SimpleDateFormat("HH"); 
449         Date date = new Date();
450         
451         if(Integer.parseInt(dateFormat.format(date)) >= 5 && Integer.parseInt(dateFormat.format(date)) < 12)
452         {
453             title = "Good Morning";
454         }
455         else if(Integer.parseInt(dateFormat.format(date)) >= 12 && Integer.parseInt(dateFormat.format(date)) < 17)
456         {
457             title = "Good Afternoon";
458         }
459         else
460         {
461             title = "Good Evening";
462         }
463         
464         lblTitle.setText(title + " " + name);
465     }
466     
467     
468     public void getInfo(String id,String user,String email,String pass)
469     {
470         txtID.setText(id);
471         txtUser.setText(user);
472         txtEmail.setText(email);
473         txtPass.setText(pass);
474     }
475     
476     public void updateData() throws IOException
477     {
478         String id,user,email,pass,line;
479         
480         String pFile = "User.txt";
481         String pFileTemp = "User_temp.txt";
482         
483         id = txtID.getText();
484         user = txtUser.getText();
485         email = txtEmail.getText();
486         pass = txtPass.getText();   
487         
488         int n = JOptionPane.showConfirmDialog(
489             null,
490             "Would you like green eggs and ham?",
491             "An Inane Question",
492             JOptionPane.YES_NO_OPTION);
493         //System.out.print(n); // Use n for response
494         
495         if(n==0)
496         {
497             File File = new File(pFile);
498             File FileTemp = new File(pFileTemp);
499             
500             BufferedWriter bw = new BufferedWriter( new FileWriter(FileTemp) );
501             BufferedReader br = new BufferedReader( new FileReader(File) );
502             
503             while((line = br.readLine()) != null) 
504             {   
505                 String[] arrFile = line.split("\\|"); 
506                 
507                 if(arrFile[0].equals(id)) 
508                 {
509                     bw.write(id+"|"+user+"|"+email+"|"+pass);
510                 }
511                 else
512                 {
513                     bw.write(line);     
514                 }                       
515                 bw.flush();
516                 bw.newLine();
517             }
518             
519             bw.close();
520             br.close(); 
521             
522             File.delete();
523             boolean success = FileTemp.renameTo(File);
524         }
525     }
526 
527     public void checkReady(String date)
528     {
529         String path = "Planner.txt";
530         
531         File file = new File(path);
532         
533         String line = null,
534                taskdate = null, 
535                status = null;
536                
537         try {
538             
539             //lblReady.setForeground(Color.green);
540             
541             BufferedReader br = new BufferedReader(new FileReader(file));
542             
543             int i = 0;
544             int allDone = 0;
545             while ((line = br.readLine()) != null) 
546             {
547                 String[] array = line.split("\\|"); 
548                 taskdate = array[2];
549                 status = array[7];
550                 
551                 if(status.equals("No") && taskdate.equals(date))
552                 {
553                     allDone++;
554                     i++;
555                 }
556                 array = null;
557             }
558             br.close();
559             
560             if(allDone == 0)
561             {
562                 lblReady.setVisible(true);
563                 btnlol.setVisible(true);
564             }
565             else
566             {
567                 lblReady.setVisible(false);
568                 btnlol.setVisible(false);
569                 lblReady.setForeground(Color.red);
570                 lblReady.setForeground(Color.green);
571                 lblReady.setForeground(Color.red);
572                 lblReady.setForeground(Color.green);
573                 lblReady.setForeground(Color.red);
574                 lblReady.setForeground(Color.green);
575                 lblReady.setForeground(Color.red);
576             }
577         } catch (IOException e) {
578             e.printStackTrace();
579         }
580     }
581     
582 //------------------------------------------------------------------
583 public static JComponent createContent() {
584     
585     JPanel contentPane = new JPanel(new BorderLayout());
586     contentPane.setBounds(38, 34, 133, 92);
587           
588     JPanel webBrowserPanel = new JPanel(new BorderLayout());
589     webBrowserPanel.setBorder(BorderFactory.createTitledBorder("Native Web Browser component"));
590     webBrowserPanel.setBounds(38, 34, 133, 92);
591           
592     final JWebBrowser webBrowser = new JWebBrowser();
593     webBrowser.navigate("https://twitter.com");
594     webBrowserPanel.add(webBrowser);
595     contentPane.add(webBrowserPanel,BorderLayout.CENTER);
596           
597     return contentPane;
598     
599 }
600 //------------------------------------------------------------------
601     
602     
603     // Variables declaration - do not modify                     
604     private javax.swing.JButton btnSave;
605     private javax.swing.JButton btnlol;
606     private javax.swing.JButton jButton10;
607     private javax.swing.JButton jButton3;
608     private javax.swing.JButton jButton4;
609     private javax.swing.JButton jButton6;
610     private javax.swing.JButton jButton7;
611     private javax.swing.JButton jButton8;
612     private javax.swing.JButton jButton9;
613     private javax.swing.JLabel jLabel1;
614     private javax.swing.JLabel jLabel2;
615     private javax.swing.JLabel jLabel3;
616     private javax.swing.JLabel jLabel4;
617     private javax.swing.JLabel jLabel5;
618     private javax.swing.JPanel jPanel1;
619     private javax.swing.JPanel jPanel2;
620     private javax.swing.JPanel jPanel3;
621     private javax.swing.JTabbedPane jTabbedPane1;
622     private javax.swing.JTabbedPane jTabbedPane2;
623     private javax.swing.JLabel lblDate;
624     private javax.swing.JLabel lblReady;
625     private javax.swing.JLabel lblTitle;
626     private java.awt.Panel panel1;
627     private javax.swing.JTextField txtEmail;
628     private javax.swing.JTextField txtID;
629     private javax.swing.JTextField txtPass;
630     private javax.swing.JTextField txtPassConfirm;
631     private javax.swing.JTextField txtUser;
632     // End of variables declaration                   
633 }
634 
635 
SAMPLE OF NETBEANS GENERATED CODE /** 113 * This method is called from within the constructor to initialize the form. 114 * WARNING: Do NOT modify this code. The content of this method is always 115 * regenerated by the Form Editor. 116 */ 117 @SuppressWarnings("unchecked") 118 // <editor-fold defaultstate="collapsed" desc="Generated Code"> 119 private void initComponents() { 120 121 jTabbedPane2 = new javax.swing.JTabbedPane(); 122 jPanel1 = new javax.swing.JPanel(); 123 lblTitle = new javax.swing.JLabel(); 124 jTabbedPane1 = new javax.swing.JTabbedPane(); 125 jPanel2 = new javax.swing.JPanel(); 126 jButton4 = new javax.swing.JButton(); 127 lblReady = new javax.swing.JLabel(); 128 btnlol = new javax.swing.JButton(); 129 jButton6 = new javax.swing.JButton(); 130 jButton7 = new javax.swing.JButton(); 131 jButton8 = new javax.swing.JButton(); 132 jButton9 = new javax.swing.JButton(); 133 jButton10 = new javax.swing.JButton(); 134 jPanel3 = new javax.swing.JPanel(); 135 btnSave = new javax.swing.JButton(); 136 jLabel1 = new javax.swing.JLabel(); 137 jLabel2 = new javax.swing.JLabel(); 138 jLabel3 = new javax.swing.JLabel(); 139 jLabel4 = new javax.swing.JLabel(); 140 jLabel5 = new javax.swing.JLabel(); 141 txtID = new javax.swing.JTextField(); 142 txtUser = new javax.swing.JTextField(); 143 txtPass = new javax.swing.JTextField(); 144 txtPassConfirm = new javax.swing.JTextField(); 145 txtEmail = new javax.swing.JTextField(); 146 lblDate = new javax.swing.JLabel(); 147 panel1 = new java.awt.Panel(); 148 jButton3 = new javax.swing.JButton(); 149 150 setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 151 152 jPanel1.setPreferredSize(new java.awt.Dimension(1000, 650)); 153 154 lblTitle.setText("Good MORNING/AFTERNOON/EVENING USERNAME"); 155 156 jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ia/man/icon/Word-icon.png"))); // NOI18N 157 158 lblReady.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N 159 lblReady.setForeground(new java.awt.Color(153, 255, 153)); 160 lblReady.setText("Ready to play League of Legends?"); 161 lblReady.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); 162 163 btnlol.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ia/man/icon/icon_lol.png"))); // NOI18N 164 165 jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ia/man/icon/Excel-icon.png"))); // NOI18N 166 167 jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ia/man/icon/Chrome-icon.png"))); // NOI18N 168 169 jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ia/man/icon/Ie-icon.png"))); // NOI18N 170 171 jButton9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ia/man/icon/Atom-icon.png"))); // NOI18N 172 173 jButton10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ia/man/icon/Terminal-icon.png"))); // NOI18N 174 175 javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); 176 jPanel2.setLayout(jPanel2Layout); 177 jPanel2Layout.setHorizontalGroup( 178 jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 179 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() 180 .addGap(30, 30, 30) 181 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 182 .addGroup(jPanel2Layout.createSequentialGroup() 183 .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) 184 .addGap(29, 29, 29) 185 .addComponent(jButton9, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)) 186 .addGroup(jPanel2Layout.createSequentialGroup() 187 .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) 188 .addGap(29, 29, 29) 189 .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)) 190 .addComponent(lblReady, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 191 .addGap(31, 31, 31) 192 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 193 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 194 .addComponent(jButton10, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) 195 .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)) 196 .addComponent(btnlol, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)) 197 .addContainerGap(33, Short.MAX_VALUE)) 198 ); 199 jPanel2Layout.setVerticalGroup( 200 jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 201 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() 202 .addGap(25, 25, 25) 203 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 204 .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE) 205 .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE) 206 .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)) 207 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 208 .addGroup(jPanel2Layout.createSequentialGroup() 209 .addGap(27, 27, 27) 210 .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)) 211 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() 212 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 213 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 214 .addComponent(jButton9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE) 215 .addComponent(jButton10, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)))) 216 .addGap(18, 18, 18) 217 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 218 .addComponent(btnlol, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) 219 .addGroup(jPanel2Layout.createSequentialGroup() 220 .addGap(21, 21, 21) 221 .addComponent(lblReady, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))) 222 .addGap(0, 19, Short.MAX_VALUE)) 223 ); 224 225 jTabbedPane1.addTab("Home", jPanel2); 226 227 btnSave.setText("Save"); 228 btnSave.addMouseListener(new java.awt.event.MouseAdapter() { 229 public void mouseClicked(java.awt.event.MouseEvent evt) { 230 btnSaveMouseClicked(evt); 231 } 232 }); 233 234 jLabel1.setText("ID"); 235 236 jLabel2.setText("User Name"); 237 238 jLabel3.setText("Email"); 239 240 jLabel4.setText("Password"); 241 242 jLabel5.setText("Confirm Password"); 243 244 javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); 245 jPanel3.setLayout(jPanel3Layout); 246 jPanel3Layout.setHorizontalGroup( 247 jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 248 .addGroup(jPanel3Layout.createSequentialGroup() 249 .addGap(70, 70, 70) 250 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 251 .addComponent(jLabel5) 252 .addComponent(jLabel4) 253 .addComponent(jLabel3) 254 .addComponent(jLabel2) 255 .addComponent(jLabel1)) 256 .addGap(18, 18, 18) 257 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 258 .addComponent(btnSave) 259 .addComponent(txtID, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) 260 .addComponent(txtUser, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) 261 .addComponent(txtPass, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) 262 .addComponent(txtPassConfirm, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) 263 .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)) 264 .addContainerGap(174, Short.MAX_VALUE)) 265 ); 266 jPanel3Layout.setVerticalGroup( 267 jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 268 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() 269 .addGap(68, 68, 68) 270 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 271 .addComponent(jLabel1) 272 .addComponent(txtID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 273 .addGap(18, 18, 18) 274 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 275 .addComponent(jLabel2) 276 .addComponent(txtUser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 277 .addGap(18, 18, 18) 278 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 279 .addComponent(jLabel3) 280 .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 281 .addGap(21, 21, 21) 282 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 283 .addComponent(jLabel4) 284 .addComponent(txtPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 285 .addGap(18, 18, 18) 286 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 287 .addComponent(jLabel5) 288 .addComponent(txtPassConfirm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 289 .addGap(18, 18, 18) 290 .addComponent(btnSave) 291 .addContainerGap(211, Short.MAX_VALUE)) 292 ); 293 294 jTabbedPane1.addTab("Setting", jPanel3); 295 296 lblDate.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); 297 lblDate.setText("jLabel6"); 298 299 javax.swing.GroupLayout panel1Layout = new javax.swing.GroupLayout(panel1); 300 panel1.setLayout(panel1Layout); 301 panel1Layout.setHorizontalGroup( 302 panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 303 .addGap(0, 352, Short.MAX_VALUE) 304 ); 305 panel1Layout.setVerticalGroup( 306 panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 307 .addGap(0, 448, Short.MAX_VALUE) 308 ); 309 310 javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); 311 jPanel1.setLayout(jPanel1Layout); 312 jPanel1Layout.setHorizontalGroup( 313 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 314 .addGroup(jPanel1Layout.createSequentialGroup() 315 .addGap(22, 22, 22) 316 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 317 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 318 .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 578, javax.swing.GroupLayout.PREFERRED_SIZE) 319 .addGap(20, 20, 20) 320 .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 321 .addGroup(jPanel1Layout.createSequentialGroup() 322 .addComponent(lblTitle) 323 .addGap(575, 575, 575) 324 .addComponent(lblDate, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))) 325 .addContainerGap(30, Short.MAX_VALUE)) 326 ); 327 jPanel1Layout.setVerticalGroup( 328 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 329 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 330 .addContainerGap() 331 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 332 .addComponent(lblTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) 333 .addComponent(lblDate)) 334 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 335 .addGroup(jPanel1Layout.createSequentialGroup() 336 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 337 .addComponent(jTabbedPane1)) 338 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 339 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 340 .addComponent(panel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 341 .addGap(24, 24, 24)))) 342 ); 343 344 jButton3.setText("Planner"); 345 jButton3.addMouseListener(new java.awt.event.MouseAdapter() { 346 public void mouseClicked(java.awt.event.MouseEvent evt) { 347 jButton3MouseClicked(evt); 348 } 349 }); 350 351 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 352 getContentPane().setLayout(layout); 353 layout.setHorizontalGroup( 354 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 355 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 1002, Short.MAX_VALUE) 356 .addGroup(layout.createSequentialGroup() 357 .addGap(21, 21, 21) 358 .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 950, javax.swing.GroupLayout.PREFERRED_SIZE) 359 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 360 ); 361 layout.setVerticalGroup( 362 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 363 .addGroup(layout.createSequentialGroup() 364 .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 567, javax.swing.GroupLayout.PREFERRED_SIZE) 365 .addGap(26, 26, 26) 366 .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) 367 .addContainerGap(33, Short.MAX_VALUE)) 368 ); 369 370 pack(); 371 }// </editor-fold> 372 373 private void btnSaveMouseClicked(java.awt.event.MouseEvent evt) { 374 // TODO add your handling code here: 375 try { 376 // TODO add your handling code here: 377 updateData(); 378 } catch (IOException ex) { 379 Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); 380 } 381 } 382 383 private void jButton3MouseClicked(java.awt.event.MouseEvent evt) { 384 // TODO add your handling code here: