/Users/johnr/Desktop/IA_14_-_Stage_P_Upload_all_2021-04-08/CSIA_TeacherOrganizer_19927 Marazal March 25th/src/TeacherLoginPage.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 
  7 
  8 /**
  9  *
 10  * @author 19927
 11  */
 12 public class TeacherLoginPage extends javax.swing.JFrame {
 13 
 14     /**
 15      * Creates new form TeacherLoginPage
 16      */
 17     public TeacherLoginPage() {
 18         initComponents();
 19     }
 20 





Netbeans auto-generated GUI code pasted at the bottom of this file.





221 
222     private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                             
223         System.exit(0);
224     }                                            
225 
226     private void jToggleButton1MouseClicked(java.awt.event.MouseEvent evt) {                                            
227         // TODO add your handling code here:
228         String ext = new String(jPasswordField1.getPassword());
229         if(jTextField1.getText().equals("user") && ext.equals("pass")){
230             jOptionPane1.showMessageDialog(null, "Login Succesful");
231         }
232         else{
233             jOptionPane1.showMessageDialog(null, "Login Failure");
234         }
235 
236     }                                           
237 
238     /**
239      * @param args the command line arguments
240      */
241     public static void main(String args[]) {
242         /* Set the Nimbus look and feel */
243         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
244         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
245          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
246          */
247         try {
248             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
249                 if ("Nimbus".equals(info.getName())) {
250                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
251                     break;
252                 }
253             }
254         } catch (ClassNotFoundException ex) {
255             java.util.logging.Logger.getLogger(TeacherLoginPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
256         } catch (InstantiationException ex) {
257             java.util.logging.Logger.getLogger(TeacherLoginPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
258         } catch (IllegalAccessException ex) {
259             java.util.logging.Logger.getLogger(TeacherLoginPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
260         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
261             java.util.logging.Logger.getLogger(TeacherLoginPage.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
262         }
263         //</editor-fold>
264 
265         /* Create and display the form */
266         java.awt.EventQueue.invokeLater(new Runnable() {
267             public void run() {
268                 new TeacherLoginPage().setVisible(true);
269             }
270         });
271     }
272 




Auto-generated Netbeans GUI code:


 21     /**
 22      * This method is called from within the constructor to initialize the form.
 23      * WARNING: Do NOT modify this code. The content of this method is always
 24      * regenerated by the Form Editor.
 25      */
 26     @SuppressWarnings("unchecked")
 27     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
 28     private void initComponents() {
 29 
 30         jTabbedPane1 = new javax.swing.JTabbedPane();
 31         jPanel1 = new javax.swing.JPanel();
 32         jLabel2 = new javax.swing.JLabel();
 33         jLabel1 = new javax.swing.JLabel();
 34         jTextField1 = new javax.swing.JTextField();
 35         jPasswordField1 = new javax.swing.JPasswordField();
 36         jLabel3 = new javax.swing.JLabel();
 37         jLabel4 = new javax.swing.JLabel();
 38         jToggleButton1 = new javax.swing.JToggleButton();
 39         jOptionPane1 = new javax.swing.JOptionPane();
 40         menuBar = new javax.swing.JMenuBar();
 41         fileMenu = new javax.swing.JMenu();
 42         openMenuItem = new javax.swing.JMenuItem();
 43         saveMenuItem = new javax.swing.JMenuItem();
 44         saveAsMenuItem = new javax.swing.JMenuItem();
 45         exitMenuItem = new javax.swing.JMenuItem();
 46         editMenu = new javax.swing.JMenu();
 47         cutMenuItem = new javax.swing.JMenuItem();
 48         copyMenuItem = new javax.swing.JMenuItem();
 49         pasteMenuItem = new javax.swing.JMenuItem();
 50         deleteMenuItem = new javax.swing.JMenuItem();
 51         helpMenu = new javax.swing.JMenu();
 52         contentsMenuItem = new javax.swing.JMenuItem();
 53         aboutMenuItem = new javax.swing.JMenuItem();
 54 
 55         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
 56 
 57         jLabel2.setFont(new java.awt.Font("Times", 1, 48)); // NOI18N
 58         jLabel2.setText("Hello!");
 59 
 60         jLabel1.setText("You need to enter the required fields below in order to proceed with the application.");
 61 
 62         jTextField1.setText("jTextField1");
 63 
 64         jPasswordField1.setText("jPasswordField1");
 65 
 66         jLabel3.setText("Teacher Name");
 67 
 68         jLabel4.setText("Password");
 69 
 70         jToggleButton1.setText("Login");
 71         jToggleButton1.addMouseListener(new java.awt.event.MouseAdapter() {
 72             public void mouseClicked(java.awt.event.MouseEvent evt) {
 73                 jToggleButton1MouseClicked(evt);
 74             }
 75         });
 76 
 77         javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
 78         jPanel1.setLayout(jPanel1Layout);
 79         jPanel1Layout.setHorizontalGroup(
 80             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 81             .addGroup(jPanel1Layout.createSequentialGroup()
 82                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
 83                     .addGroup(jPanel1Layout.createSequentialGroup()
 84                         .addGap(342, 342, 342)
 85                         .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))
 86                     .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
 87                         .addGap(205, 205, 205)
 88                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 89                             .addComponent(jLabel4)
 90                             .addGroup(jPanel1Layout.createSequentialGroup()
 91                                 .addComponent(jLabel3)
 92                                 .addGap(48, 48, 48)
 93                                 .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)))))
 94                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 95             .addGroup(jPanel1Layout.createSequentialGroup()
 96                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 97                     .addGroup(jPanel1Layout.createSequentialGroup()
 98                         .addGap(317, 317, 317)
 99                         .addComponent(jLabel2))
100                     .addGroup(jPanel1Layout.createSequentialGroup()
101                         .addGap(115, 115, 115)
102                         .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 536, javax.swing.GroupLayout.PREFERRED_SIZE)))
103                 .addGap(0, 122, Short.MAX_VALUE))
104             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
105                 .addGap(0, 0, Short.MAX_VALUE)
106                 .addComponent(jToggleButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
107                 .addGap(79, 79, 79)
108                 .addComponent(jOptionPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
109                 .addGap(17, 17, 17))
110         );
111         jPanel1Layout.setVerticalGroup(
112             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
113             .addGroup(jPanel1Layout.createSequentialGroup()
114                 .addGap(56, 56, 56)
115                 .addComponent(jLabel2)
116                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
117                     .addGroup(jPanel1Layout.createSequentialGroup()
118                         .addGap(18, 18, 18)
119                         .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
120                         .addGap(18, 18, 18)
121                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
122                             .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
123                             .addComponent(jLabel3))
124                         .addGap(18, 18, 18)
125                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
126                             .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
127                             .addComponent(jLabel4))
128                         .addGap(18, 18, 18)
129                         .addComponent(jToggleButton1)
130                         .addContainerGap(108, Short.MAX_VALUE))
131                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
132                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
133                         .addComponent(jOptionPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
134                         .addGap(28, 28, 28))))
135         );
136 
137         jTabbedPane1.addTab("Login", jPanel1);
138 
139         fileMenu.setMnemonic('f');
140         fileMenu.setText("File");
141 
142         openMenuItem.setMnemonic('o');
143         openMenuItem.setText("Open");
144         fileMenu.add(openMenuItem);
145 
146         saveMenuItem.setMnemonic('s');
147         saveMenuItem.setText("Save");
148         fileMenu.add(saveMenuItem);
149 
150         saveAsMenuItem.setMnemonic('a');
151         saveAsMenuItem.setText("Save As ...");
152         saveAsMenuItem.setDisplayedMnemonicIndex(5);
153         fileMenu.add(saveAsMenuItem);
154 
155         exitMenuItem.setMnemonic('x');
156         exitMenuItem.setText("Exit");
157         exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
158             public void actionPerformed(java.awt.event.ActionEvent evt) {
159                 exitMenuItemActionPerformed(evt);
160             }
161         });
162         fileMenu.add(exitMenuItem);
163 
164         menuBar.add(fileMenu);
165 
166         editMenu.setMnemonic('e');
167         editMenu.setText("Edit");
168 
169         cutMenuItem.setMnemonic('t');
170         cutMenuItem.setText("Cut");
171         editMenu.add(cutMenuItem);
172 
173         copyMenuItem.setMnemonic('y');
174         copyMenuItem.setText("Copy");
175         editMenu.add(copyMenuItem);
176 
177         pasteMenuItem.setMnemonic('p');
178         pasteMenuItem.setText("Paste");
179         editMenu.add(pasteMenuItem);
180 
181         deleteMenuItem.setMnemonic('d');
182         deleteMenuItem.setText("Delete");
183         editMenu.add(deleteMenuItem);
184 
185         menuBar.add(editMenu);
186 
187         helpMenu.setMnemonic('h');
188         helpMenu.setText("Help");
189 
190         contentsMenuItem.setMnemonic('c');
191         contentsMenuItem.setText("Contents");
192         helpMenu.add(contentsMenuItem);
193 
194         aboutMenuItem.setMnemonic('a');
195         aboutMenuItem.setText("About");
196         helpMenu.add(aboutMenuItem);
197 
198         menuBar.add(helpMenu);
199 
200         setJMenuBar(menuBar);
201 
202         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
203         getContentPane().setLayout(layout);
204         layout.setHorizontalGroup(
205             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
206             .addGroup(layout.createSequentialGroup()
207                 .addGap(20, 20, 20)
208                 .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 794, javax.swing.GroupLayout.PREFERRED_SIZE)
209                 .addContainerGap(16, Short.MAX_VALUE))
210         );
211         layout.setVerticalGroup(
212             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
213             .addGroup(layout.createSequentialGroup()
214                 .addGap(18, 18, 18)
215                 .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 458, javax.swing.GroupLayout.PREFERRED_SIZE)
216                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
217         );
218 
219         pack();
220     }// </editor-fold>                        





273     // Variables declaration - do not modify                     
274     private javax.swing.JMenuItem aboutMenuItem;
275     private javax.swing.JMenuItem contentsMenuItem;
276     private javax.swing.JMenuItem copyMenuItem;
277     private javax.swing.JMenuItem cutMenuItem;
278     private javax.swing.JMenuItem deleteMenuItem;
279     private javax.swing.JMenu editMenu;
280     private javax.swing.JMenuItem exitMenuItem;
281     private javax.swing.JMenu fileMenu;
282     private javax.swing.JMenu helpMenu;
283     private javax.swing.JLabel jLabel1;
284     private javax.swing.JLabel jLabel2;
285     private javax.swing.JLabel jLabel3;
286     private javax.swing.JLabel jLabel4;
287     private javax.swing.JOptionPane jOptionPane1;
288     private javax.swing.JPanel jPanel1;
289     private javax.swing.JPasswordField jPasswordField1;
290     private javax.swing.JTabbedPane jTabbedPane1;
291     private javax.swing.JTextField jTextField1;
292     private javax.swing.JToggleButton jToggleButton1;
293     private javax.swing.JMenuBar menuBar;
294     private javax.swing.JMenuItem openMenuItem;
295     private javax.swing.JMenuItem pasteMenuItem;
296     private javax.swing.JMenuItem saveAsMenuItem;
297     private javax.swing.JMenuItem saveMenuItem;
298     // End of variables declaration                   
299 
300 }
301