C:\Users\Man\Desktop\IA_FinaL_Submission_000307-0092\Product\IA_Netbeans_Project\src\ia\man\Home.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 import chrriis.common.UIUtils;
  9 import chrriis.dj.nativeswing.swtimpl.NativeInterface;
 10 import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser;
 11 import static ia.man.Main.createContent;
 12 import java.awt.BorderLayout;
 13 import java.awt.Color;
 14 import java.awt.Dimension;
 15 import java.awt.FlowLayout;
 16 import static java.awt.SystemColor.desktop;
 17 import java.awt.Toolkit;
 18 import java.awt.event.ItemEvent;
 19 import java.awt.event.ItemListener;
 20 import java.io.BufferedReader;
 21 import java.io.BufferedWriter;
 22 import java.io.File;
 23 import java.io.FileReader;
 24 import java.io.FileWriter;
 25 import java.io.IOException;
 26 import java.net.URI;
 27 import java.net.URISyntaxException;
 28 import java.text.DateFormat;
 29 import java.text.SimpleDateFormat;
 30 import java.util.Date;
 31 import java.util.logging.Level;
 32 import java.util.logging.Logger;
 33 import javax.swing.BorderFactory;
 34 import javax.swing.JCheckBox;
 35 import javax.swing.JComponent;
 36 import javax.swing.JFrame;
 37 import javax.swing.JOptionPane;
 38 import javax.swing.JPanel;
 39 
 40 /**
 41  *
 42  * @author Seksan.Ma
 43  */
 44 public class Home extends javax.swing.JFrame {
 45 
 46     static{
 47     //NativeInterface.open();
 48     //UIUtils.setPreferredLookAndFeel();
 49     //twPanel.add(createContent());
 50     }
 51     /**
 52      * Creates new form NewJFrame
 53      */
 54     User iUser = new User();
 55     
 56     public String isLogin = "";
 57     
 58     public Home() {
 59         
 60         
 61         //NativeInterface.open();
 62         //UIUtils.setPreferredLookAndFeel();
 63         
 64         initComponents();
 65         
 66         Toolkit toolkit = getToolkit();
 67         Dimension size = toolkit.getScreenSize();
 68         setLocation(size.width/2 - getWidth()/2, size.height/2 - getHeight()/2);
 69         
 70         try
 71         {
 72             //twPanel.add(createContent());
 73         }
 74         catch(Exception e)
 75         {
 76             //Nothing
 77         }
 78         
 79         
 80         
 81 
 82     }
 83     
 84     public Home(String id,String user,String email,String pass) throws IOException {
 85         
 86         NativeInterface.open();
 87         UIUtils.setPreferredLookAndFeel();
 88         
 89         initComponents();
 90         
 91         iUser.AssingValue(id, user, email, pass);
 92         
 93         Toolkit toolkit = getToolkit();
 94         Dimension size = toolkit.getScreenSize();
 95         setLocation(size.width/2 - getWidth()/2, size.height/2 - getHeight()/2);
 96         
 97         try
 98         {
 99             twPanel.add(createContent());
100         }
101         catch(Exception e)
102         {
103             //Nothing
104         }
105         
106         DateFormat dateFormat = new SimpleDateFormat("MM-dd");
107         DateFormat yearFormat = new SimpleDateFormat("yyyy");
108         Date date = new Date();
109         
110         String year = yearFormat.format(date);
111         //int bc_year = Integer.parseInt(year) - 543;
112         int bc_year = Integer.parseInt(year);
113          
114         String Current_Date = String.valueOf(bc_year) + "-" + dateFormat.format(date); 
115         
116         lblDate.setText(Current_Date);
117         
118         setTitle(user);
119         getInfo(id,user,email,pass);
120         
121         //twPanel.add(createContent()); 
122         
123         new Thread(() -> 
124         {
125            
126            while(true)
127            {
128             checkReady(lblDate.getText());
129             try {
130                 Thread.sleep(500);
131             } catch (InterruptedException ex) {
132                 Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);
133             }
134            }
135         }).start();
136         
137     }
138     
139     public void checkLogin()
140     {
141         if(isLogin.equals(""))
142         {
143             Login Login = new Login();
144             this.setVisible(false);
145             Login.setVisible(true);
146         }
147     }
148     
149   
460     private void btnSaveMouseClicked(java.awt.event.MouseEvent evt) {                                     
461         // TODO add your handling code here:
462         try {
463             // TODO add your handling code here:
464             updateData();
465         } catch (IOException ex) {
466             Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
467         }
468     }                                    
469 
470     private void btnToTwitterMouseClicked(java.awt.event.MouseEvent evt) {                                          
471         try {
472             // TODO add your handling code here:
473 
474             URI uri = new URI("https://twitter.com");
475             java.awt.Desktop.getDesktop().browse(uri);
476             
477         } catch (URISyntaxException ex) {
478             Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);
479         } catch (IOException ex) {
480             Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);
481         }
482 
483     }                                         
484 
485     private void btnlolMouseClicked(java.awt.event.MouseEvent evt) {                                    
486         try {
487             // TODO add your handling code here:
488             //String cmd = "C:\\Riot Games\\Riot Client\\RiotClientServices.exe\" --launch-product=league_of_legends --launch-patchline=live";
489             //try {
490             //    Runtime.getRuntime().exec(cmd);
491             //} catch (IOException ex) {
492             //    Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);
493             //}
494             
495             //desktop.open("C:/Windows/System32/cmd.exe");
496 
497             //Process p = Runtime.getRuntime().exec(new String[] {"C:\\Windows\\System32\\cmd.exe"});
498             ProcessBuilder p = new ProcessBuilder("C:\\Program Files (x86)\\Garena\\Garena\\Garena.exe");
499             p.start();
500             
501         } catch (IOException ex) {
502             Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);
503         }
504 
505     }                                   
506 
507     private void btnPowershellMouseClicked(java.awt.event.MouseEvent evt) {                                           
508         // TODO add your handling code here:
509         String cmd = "%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe";
510         try {
511             Runtime.getRuntime().exec(cmd);
512         } catch (IOException ex) {
513             Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);
514         }
515     }                                          
516 
517     private void btnAtomMouseClicked(java.awt.event.MouseEvent evt) {                                     
518         // TODO add your handling code here:
519         String cmd = "C:\\Users\\Man\\AppData\\Local\\atom\\atom.exe";
520         try {
521             Runtime.getRuntime().exec(cmd);
522         } catch (IOException ex) {
523             Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);
524         }
525     }                                    
526 
527     private void btnTerminalMouseClicked(java.awt.event.MouseEvent evt) {                                         
528         // TODO add your handling code here:
529         String cmd = "system32\\cmd.exe";
530         try {
531             Runtime.getRuntime().exec(cmd);
532         } catch (IOException ex) {
533             Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);
534         }
535     }                                        
536 
537     private void btnPlannerMouseClicked(java.awt.event.MouseEvent evt) {                                        
538         // TODO add your handling code here:
539         String id,user,email,pass;
540 
541         id = iUser.getID();
542         user = iUser.getUser();
543         email = iUser.getEmail();
544         pass = iUser.getPass();
545 
546         Planner planner = new Planner(id,user,email,pass);
547         planner.setVisible(true);
548     }                                       
549 
550     /**
551      * @param args the command line arguments
552      */
553     public static void main(String args[]) {
554         
555         /* Set the Nimbus look and feel */
556         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
557         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
558          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
559          */
560         
561         NativeInterface.open();
562         UIUtils.setPreferredLookAndFeel();
563         
564         try {
565             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
566                 if ("Nimbus".equals(info.getName())) {
567                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
568                     break;
569                 }
570             }
571         } catch (ClassNotFoundException ex) {
572             java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
573         } catch (InstantiationException ex) {
574             java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
575         } catch (IllegalAccessException ex) {
576             java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
577         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
578             java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
579         }
580         //</editor-fold>
581         //</editor-fold>
582         /* Create and display the form */
583         java.awt.EventQueue.invokeLater(new Runnable() {
584             public void run() {
585                 new Home().setVisible(true);
586             }
587         });
588         
589         NativeInterface.runEventPump();
590         
591     }
592 
593     public void setTitle(String name)
594     {
595         String title = null;
596         SimpleDateFormat dateFormat = new SimpleDateFormat("HH"); 
597         Date date = new Date();
598         
599         if(Integer.parseInt(dateFormat.format(date)) >= 5 && Integer.parseInt(dateFormat.format(date)) < 12)
600         {
601             title = "Good Morning";
602         }
603         else if(Integer.parseInt(dateFormat.format(date)) >= 12 && Integer.parseInt(dateFormat.format(date)) < 17)
604         {
605             title = "Good Afternoon";
606         }
607         else
608         {
609             title = "Good Evening";
610         }
611         
612         lblTitle.setText(title + " " + name);
613     }
614     
615     
616     public void getInfo(String id,String user,String email,String pass)
617     {
618         txtID.setText(id);
619         txtUser.setText(user);
620         txtEmail.setText(email);
621         txtPass.setText(pass);
622     }
623     
624     public void updateData() throws IOException
625     {
626         String id,user,email,pass,line;
627         
628         String pFile = "User.txt";
629         String pFileTemp = "User_temp.txt";
630         
631         id = txtID.getText();
632         user = txtUser.getText();
633         email = txtEmail.getText();
634         pass = txtPass.getText();   
635         
636         int n = JOptionPane.showConfirmDialog(
637             null,
638             "User information updated!",
639             "Please restart application.",
640             JOptionPane.YES_NO_OPTION);
641         //System.out.print(n); // Use n for response
642         
643         if(n==0)
644         {
645             File File = new File(pFile);
646             File FileTemp = new File(pFileTemp);
647             
648             BufferedWriter bw = new BufferedWriter( new FileWriter(FileTemp) );
649             BufferedReader br = new BufferedReader( new FileReader(File) );
650             
651             while((line = br.readLine()) != null) 
652             {   
653                 String[] arrFile = line.split("\\|"); 
654                 
655                 if(arrFile[0].equals(id)) 
656                 {
657                     bw.write(id+"|"+user+"|"+email+"|"+pass);
658                 }
659                 else
660                 {
661                     bw.write(line);     
662                 }                       
663                 bw.flush();
664                 bw.newLine();
665             }
666             
667             bw.close();
668             br.close(); 
669             
670             File.delete();
671             boolean success = FileTemp.renameTo(File);
672         }
673     }
674 
675     public void checkReady(String date)
676     {
677         String path = "Planner.txt";
678         
679         File file = new File(path);
680         
681         String line = null,
682                taskdate = null, 
683                status = null;
684                
685         try {
686             
687             //lblReady.setForeground(Color.green);
688             
689             BufferedReader br = new BufferedReader(new FileReader(file));
690             
691             int i = 0;
692             int allDone = 0;
693             while ((line = br.readLine()) != null) 
694             {
695                 String[] array = line.split("\\|"); 
696                 taskdate = array[2];
697                 status = array[7];
698                 
699                 if(status.equals("No") && taskdate.equals(date))
700                 {
701                     allDone++;
702                     i++;
703                 }
704                 array = null;
705             }
706             br.close();
707             
708             if(allDone == 0)
709             {
710                 lblReady.setVisible(true);
711                 btnlol.setVisible(true);
712             }
713             else
714             {
715                 lblReady.setVisible(false);
716                 btnlol.setVisible(false);
717                 lblReady.setForeground(Color.red);
718                 lblReady.setForeground(Color.green);
719                 lblReady.setForeground(Color.red);
720                 lblReady.setForeground(Color.green);
721                 lblReady.setForeground(Color.red);
722                 lblReady.setForeground(Color.green);
723                 lblReady.setForeground(Color.red);
724             }
725         } catch (IOException e) {
726             e.printStackTrace();
727         }
728     }
729     
730     public static JComponent createContent() {
731         
732         JPanel contentPane = new JPanel(new BorderLayout());
733           contentPane.setBounds(0, 0, 750, 660);
734         try{
735 
736           JPanel webBrowserPanel = new JPanel(new BorderLayout());
737           webBrowserPanel.setBorder(BorderFactory.createTitledBorder("Twitter"));
738           //webBrowserPanel.setBounds(38, 34, 133, 500);
739           
740           final JWebBrowser webBrowser = new JWebBrowser();
741           webBrowser.navigate("https://twitter.com");
742           webBrowserPanel.add(webBrowser);
743           contentPane.add(webBrowserPanel,BorderLayout.CENTER);
744           
745         }catch(Exception e)
746         {
747             //Nothing
748         }
749           return contentPane; 
750     }    
751     
752     // Variables declaration - do not modify                     
753     private javax.swing.JButton btnAtom;
754     private javax.swing.JButton btnPlanner;
755     private javax.swing.JButton btnPowershell;
756     private javax.swing.JButton btnSave;
757     private javax.swing.JButton btnTerminal;
758     private javax.swing.JButton btnToTwitter;
759     private javax.swing.JButton btnlol;
760     private javax.swing.JFrame jFrame1;
761     private javax.swing.JLabel jLabel1;
762     private javax.swing.JLabel jLabel2;
763     private javax.swing.JLabel jLabel3;
764     private javax.swing.JLabel jLabel4;
765     private javax.swing.JLabel jLabel5;
766     private javax.swing.JLabel jLabel6;
767     private javax.swing.JLabel jLabel7;
768     private javax.swing.JLabel jLabel8;
769     private javax.swing.JPanel jPanel2;
770     private javax.swing.JPanel jPanel3;
771     private javax.swing.JTabbedPane jTabbedPane1;
772     private javax.swing.JLabel lblDate;
773     private javax.swing.JLabel lblReady;
774     private javax.swing.JLabel lblTitle;
775     private java.awt.Panel panel1;
776     private java.awt.Panel twPanel;
777     private javax.swing.JTextField txtEmail;
778     private javax.swing.JTextField txtID;
779     private javax.swing.JTextField txtPass;
780     private javax.swing.JTextField txtPassConfirm;
781     private javax.swing.JTextField txtUser;
782     // End of variables declaration                   
783 }
784 
SAMPLE OF GENERATED CODE BY NETBEANS /** 150 * This method is called from within the constructor to initialize the form. 151 * WARNING: Do NOT modify this code. The content of this method is always 152 * regenerated by the Form Editor. 153 */ 154 @SuppressWarnings("unchecked") 155 // <editor-fold defaultstate="collapsed" desc="Generated Code"> 156 private void initComponents() { 157 158 jFrame1 = new javax.swing.JFrame(); 159 panel1 = new java.awt.Panel(); 160 twPanel = new java.awt.Panel(); 161 jTabbedPane1 = new javax.swing.JTabbedPane(); 162 jPanel2 = new javax.swing.JPanel(); 163 lblReady = new javax.swing.JLabel(); 164 btnlol = new javax.swing.JButton(); 165 btnPowershell = new javax.swing.JButton(); 166 btnAtom = new javax.swing.JButton(); 167 btnTerminal = new javax.swing.JButton(); 168 jLabel6 = new javax.swing.JLabel(); 169 jLabel7 = new javax.swing.JLabel(); 170 jLabel8 = new javax.swing.JLabel(); 171 jPanel3 = new javax.swing.JPanel(); 172 btnSave = new javax.swing.JButton(); 173 jLabel1 = new javax.swing.JLabel(); 174 jLabel2 = new javax.swing.JLabel(); 175 jLabel3 = new javax.swing.JLabel(); 176 jLabel4 = new javax.swing.JLabel(); 177 jLabel5 = new javax.swing.JLabel(); 178 txtID = new javax.swing.JTextField(); 179 txtUser = new javax.swing.JTextField(); 180 txtPass = new javax.swing.JTextField(); 181 txtPassConfirm = new javax.swing.JTextField(); 182 txtEmail = new javax.swing.JTextField(); 183 lblTitle = new javax.swing.JLabel(); 184 lblDate = new javax.swing.JLabel(); 185 btnToTwitter = new javax.swing.JButton(); 186 btnPlanner = new javax.swing.JButton(); 187 188 javax.swing.GroupLayout jFrame1Layout = new javax.swing.GroupLayout(jFrame1.getContentPane()); 189 jFrame1.getContentPane().setLayout(jFrame1Layout); 190 jFrame1Layout.setHorizontalGroup( 191 jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 192 .addGap(0, 400, Short.MAX_VALUE) 193 ); 194 jFrame1Layout.setVerticalGroup( 195 jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 196 .addGap(0, 300, Short.MAX_VALUE) 197 ); 198 199 javax.swing.GroupLayout panel1Layout = new javax.swing.GroupLayout(panel1); 200 panel1.setLayout(panel1Layout); 201 panel1Layout.setHorizontalGroup( 202 panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 203 .addGap(0, 100, Short.MAX_VALUE) 204 ); 205 panel1Layout.setVerticalGroup( 206 panel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 207 .addGap(0, 100, Short.MAX_VALUE) 208 ); 209 210 setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 211 212 twPanel.setBackground(new java.awt.Color(204, 204, 204)); 213 214 javax.swing.GroupLayout twPanelLayout = new javax.swing.GroupLayout(twPanel); 215 twPanel.setLayout(twPanelLayout); 216 twPanelLayout.setHorizontalGroup( 217 twPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 218 .addGap(0, 887, Short.MAX_VALUE) 219 ); 220 twPanelLayout.setVerticalGroup( 221 twPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 222 .addGap(0, 0, Short.MAX_VALUE) 223 ); 224 225 lblReady.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N 226 lblReady.setForeground(new java.awt.Color(0, 204, 255)); 227 lblReady.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); 228 lblReady.setText("Games are now playable!"); 229 lblReady.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); 230 231 btnlol.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ia/man/icon/icon_lol.png"))); // NOI18N 232 btnlol.addMouseListener(new java.awt.event.MouseAdapter() { 233 public void mouseClicked(java.awt.event.MouseEvent evt) { 234 btnlolMouseClicked(evt); 235 } 236 }); 237 238 btnPowershell.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ia/man/icon/Terminal-icon.png"))); // NOI18N 239 btnPowershell.addMouseListener(new java.awt.event.MouseAdapter() { 240 public void mouseClicked(java.awt.event.MouseEvent evt) { 241 btnPowershellMouseClicked(evt); 242 } 243 }); 244 245 btnAtom.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ia/man/icon/Atom-icon.png"))); // NOI18N 246 btnAtom.addMouseListener(new java.awt.event.MouseAdapter() { 247 public void mouseClicked(java.awt.event.MouseEvent evt) { 248 btnAtomMouseClicked(evt); 249 } 250 }); 251 252 btnTerminal.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ia/man/icon/Terminal-icon.png"))); // NOI18N 253 btnTerminal.addMouseListener(new java.awt.event.MouseAdapter() { 254 public void mouseClicked(java.awt.event.MouseEvent evt) { 255 btnTerminalMouseClicked(evt); 256 } 257 }); 258 259 jLabel6.setText("PowerShell"); 260 261 jLabel7.setText("CMD"); 262 263 jLabel8.setText("Atom"); 264 265 javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); 266 jPanel2.setLayout(jPanel2Layout); 267 jPanel2Layout.setHorizontalGroup( 268 jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 269 .addGroup(jPanel2Layout.createSequentialGroup() 270 .addGap(17, 17, 17) 271 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 272 .addComponent(lblReady, javax.swing.GroupLayout.PREFERRED_SIZE, 360, javax.swing.GroupLayout.PREFERRED_SIZE) 273 .addGroup(jPanel2Layout.createSequentialGroup() 274 .addComponent(btnPowershell, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE) 275 .addGap(60, 60, 60) 276 .addComponent(btnAtom, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))) 277 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 278 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() 279 .addGap(50, 50, 50) 280 .addComponent(btnTerminal, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)) 281 .addGroup(jPanel2Layout.createSequentialGroup() 282 .addGap(18, 18, 18) 283 .addComponent(btnlol, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE))) 284 .addContainerGap(30, Short.MAX_VALUE)) 285 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() 286 .addGap(60, 60, 60) 287 .addComponent(jLabel6) 288 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 289 .addComponent(jLabel8) 290 .addGap(177, 177, 177) 291 .addComponent(jLabel7) 292 .addGap(92, 92, 92)) 293 ); 294 jPanel2Layout.setVerticalGroup( 295 jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 296 .addGroup(jPanel2Layout.createSequentialGroup() 297 .addGap(83, 83, 83) 298 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 299 .addComponent(jLabel7) 300 .addComponent(jLabel6) 301 .addComponent(jLabel8)) 302 .addGap(18, 18, 18) 303 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 304 .addComponent(btnTerminal, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE) 305 .addComponent(btnPowershell, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE) 306 .addComponent(btnAtom, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)) 307 .addGap(51, 51, 51) 308 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 309 .addComponent(btnlol, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) 310 .addGroup(jPanel2Layout.createSequentialGroup() 311 .addGap(32, 32, 32) 312 .addComponent(lblReady, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))) 313 .addContainerGap(58, Short.MAX_VALUE)) 314 ); 315 316 jTabbedPane1.addTab("Home", jPanel2); 317 318 btnSave.setText("Save"); 319 btnSave.addMouseListener(new java.awt.event.MouseAdapter() { 320 public void mouseClicked(java.awt.event.MouseEvent evt) { 321 btnSaveMouseClicked(evt); 322 } 323 }); 324 325 jLabel1.setText("ID"); 326 327 jLabel2.setText("User Name"); 328 329 jLabel3.setText("Email"); 330 331 jLabel4.setText("Password"); 332 333 jLabel5.setText("Confirm Password"); 334 335 javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); 336 jPanel3.setLayout(jPanel3Layout); 337 jPanel3Layout.setHorizontalGroup( 338 jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 339 .addGroup(jPanel3Layout.createSequentialGroup() 340 .addGap(70, 70, 70) 341 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 342 .addComponent(jLabel5) 343 .addComponent(jLabel4) 344 .addComponent(jLabel3) 345 .addComponent(jLabel2) 346 .addComponent(jLabel1)) 347 .addGap(18, 18, 18) 348 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 349 .addComponent(btnSave) 350 .addComponent(txtID, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) 351 .addComponent(txtUser, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) 352 .addComponent(txtPass, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) 353 .addComponent(txtPassConfirm, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) 354 .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)) 355 .addContainerGap(208, Short.MAX_VALUE)) 356 ); 357 jPanel3Layout.setVerticalGroup( 358 jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 359 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() 360 .addGap(68, 68, 68) 361 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 362 .addComponent(jLabel1) 363 .addComponent(txtID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 364 .addGap(18, 18, 18) 365 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 366 .addComponent(jLabel2) 367 .addComponent(txtUser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 368 .addGap(18, 18, 18) 369 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 370 .addComponent(jLabel3) 371 .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 372 .addGap(21, 21, 21) 373 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 374 .addComponent(jLabel4) 375 .addComponent(txtPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 376 .addGap(18, 18, 18) 377 .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 378 .addComponent(jLabel5) 379 .addComponent(txtPassConfirm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 380 .addGap(18, 18, 18) 381 .addComponent(btnSave) 382 .addContainerGap(159, Short.MAX_VALUE)) 383 ); 384 385 jTabbedPane1.addTab("Setting", jPanel3); 386 387 lblTitle.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N 388 lblTitle.setText("Good MORNING/AFTERNOON/EVENING USERNAME"); 389 390 lblDate.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N 391 lblDate.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); 392 lblDate.setText("jLabel6"); 393 394 btnToTwitter.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N 395 btnToTwitter.setText("Twitter"); 396 btnToTwitter.addMouseListener(new java.awt.event.MouseAdapter() { 397 public void mouseClicked(java.awt.event.MouseEvent evt) { 398 btnToTwitterMouseClicked(evt); 399 } 400 }); 401 402 btnPlanner.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N 403 btnPlanner.setText("Planner"); 404 btnPlanner.addMouseListener(new java.awt.event.MouseAdapter() { 405 public void mouseClicked(java.awt.event.MouseEvent evt) { 406 btnPlannerMouseClicked(evt); 407 } 408 }); 409 410 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 411 getContentPane().setLayout(layout); 412 layout.setHorizontalGroup( 413 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 414 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 415 .addGap(0, 0, Short.MAX_VALUE) 416 .addComponent(btnToTwitter, javax.swing.GroupLayout.PREFERRED_SIZE, 887, javax.swing.GroupLayout.PREFERRED_SIZE) 417 .addGap(16, 16, 16)) 418 .addGroup(layout.createSequentialGroup() 419 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 420 .addGroup(layout.createSequentialGroup() 421 .addGap(27, 27, 27) 422 .addComponent(lblTitle) 423 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 424 .addComponent(lblDate, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)) 425 .addGroup(layout.createSequentialGroup() 426 .addContainerGap() 427 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 428 .addGroup(layout.createSequentialGroup() 429 .addGap(10, 10, 10) 430 .addComponent(btnPlanner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 431 .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 432 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE))) 433 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 434 .addComponent(twPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 435 .addGap(6, 6, 6)) 436 ); 437 layout.setVerticalGroup( 438 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 439 .addGroup(layout.createSequentialGroup() 440 .addContainerGap() 441 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 442 .addGroup(layout.createSequentialGroup() 443 .addComponent(twPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 444 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 445 .addComponent(btnToTwitter, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)) 446 .addGroup(layout.createSequentialGroup() 447 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 448 .addComponent(lblTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) 449 .addComponent(lblDate)) 450 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 451 .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 525, javax.swing.GroupLayout.PREFERRED_SIZE) 452 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 453 .addComponent(btnPlanner, javax.swing.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE) 454 .addContainerGap()))) 455 ); 456 457 pack(); 458 }// </editor-fold> 459