rootUser

[DB][3.1] Diary.java

Jan 22nd, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 7.60 KB | None | 0 0
  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 diary;
  7.  
  8. import java.awt.Color;
  9.  
  10. /**
  11.  *
  12.  * @author root
  13.  */
  14. public class Diary extends javax.swing.JFrame
  15. {
  16.  
  17.     /**
  18.      * Creates new form Menu
  19.      */
  20.     public Diary()
  21.     {
  22.         initComponents();
  23.         getContentPane().setBackground(Color.BLACK);
  24.     }
  25.  
  26.     /**
  27.      * This method is called from within the constructor to initialize the form.
  28.      * WARNING: Do NOT modify this code. The content of this method is always
  29.      * regenerated by the Form Editor.
  30.      */
  31.     @SuppressWarnings("unchecked")
  32.     // <editor-fold defaultstate="collapsed" desc="Generated Code">
  33.     private void initComponents()
  34.     {
  35.  
  36.         welcomeLabel = new javax.swing.JLabel();
  37.         diaryLabel = new javax.swing.JLabel();
  38.         continueLabel = new javax.swing.JLabel();
  39.         continueButton = new javax.swing.JButton();
  40.         exitButton = new javax.swing.JButton();
  41.  
  42.         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  43.  
  44.         welcomeLabel.setFont(new java.awt.Font("Microsoft YaHei", 1, 12)); // NOI18N
  45.         welcomeLabel.setForeground(new java.awt.Color(0, 153, 255));
  46.         welcomeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
  47.         welcomeLabel.setText("WELCOME");
  48.  
  49.         diaryLabel.setFont(new java.awt.Font("Lucida Handwriting", 1, 12)); // NOI18N
  50.         diaryLabel.setForeground(new java.awt.Color(255, 0, 102));
  51.         diaryLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
  52.         diaryLabel.setText("THIS IS YOUR PERSONAL DIARY");
  53.  
  54.         continueLabel.setFont(new java.awt.Font("Kristen ITC", 1, 12)); // NOI18N
  55.         continueLabel.setForeground(new java.awt.Color(51, 204, 0));
  56.         continueLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
  57.         continueLabel.setText("CLICK 'CONTINUE' TO USE THIS APP");
  58.  
  59.         continueButton.setBackground(new java.awt.Color(51, 51, 51));
  60.         continueButton.setFont(new java.awt.Font("Papyrus", 1, 12)); // NOI18N
  61.         continueButton.setForeground(new java.awt.Color(0, 255, 255));
  62.         continueButton.setText("CONTINUE");
  63.         continueButton.addActionListener(new java.awt.event.ActionListener()
  64.         {
  65.             public void actionPerformed(java.awt.event.ActionEvent evt)
  66.             {
  67.                 continueButtonActionPerformed(evt);
  68.             }
  69.         });
  70.  
  71.         exitButton.setBackground(new java.awt.Color(51, 51, 51));
  72.         exitButton.setFont(new java.awt.Font("Papyrus", 1, 12)); // NOI18N
  73.         exitButton.setForeground(new java.awt.Color(255, 255, 0));
  74.         exitButton.setText("EXIT");
  75.         exitButton.addActionListener(new java.awt.event.ActionListener()
  76.         {
  77.             public void actionPerformed(java.awt.event.ActionEvent evt)
  78.             {
  79.                 exitButtonActionPerformed(evt);
  80.             }
  81.         });
  82.  
  83.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  84.         getContentPane().setLayout(layout);
  85.         layout.setHorizontalGroup(
  86.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  87.             .addComponent(continueLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  88.             .addGroup(layout.createSequentialGroup()
  89.                       .addContainerGap()
  90.                       .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  91.                                 .addComponent(exitButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  92.                                 .addComponent(continueButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  93.                                 .addComponent(diaryLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  94.                                 .addComponent(welcomeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 390, Short.MAX_VALUE))
  95.                       .addContainerGap())
  96.         );
  97.         layout.setVerticalGroup(
  98.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  99.             .addGroup(layout.createSequentialGroup()
  100.                       .addContainerGap()
  101.                       .addComponent(welcomeLabel)
  102.                       .addGap(18, 18, 18)
  103.                       .addComponent(diaryLabel)
  104.                       .addGap(18, 18, 18)
  105.                       .addComponent(continueLabel)
  106.                       .addGap(87, 87, 87)
  107.                       .addComponent(continueButton)
  108.                       .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE)
  109.                       .addComponent(exitButton)
  110.                       .addContainerGap())
  111.         );
  112.  
  113.         pack();
  114.         setLocationRelativeTo(null);
  115.     }// </editor-fold>
  116.  
  117.     private void exitButtonActionPerformed(java.awt.event.ActionEvent evt)
  118.     {
  119.         // TODO add your handling code here:
  120.         System.exit(0);
  121.     }
  122.  
  123.     private void continueButtonActionPerformed(java.awt.event.ActionEvent evt)
  124.     {
  125.         // TODO add your handling code here:
  126.         this.setVisible(false);
  127.         Menu menu = new Menu();
  128.         menu.setVisible(true);
  129.     }
  130.  
  131.     /**
  132.      * @param args the command line arguments
  133.      */
  134.     public static void main(String args[])
  135.     {
  136.         /* Set the Nimbus look and feel */
  137.         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  138.         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  139.          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  140.          */
  141.         try
  142.         {
  143.             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
  144.             {
  145.                 if ("Nimbus".equals(info.getName()))
  146.                 {
  147.                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
  148.                     break;
  149.                 }
  150.             }
  151.         }
  152.         catch (ClassNotFoundException ex)
  153.         {
  154.             java.util.logging.Logger.getLogger(Diary.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  155.         }
  156.         catch (InstantiationException ex)
  157.         {
  158.             java.util.logging.Logger.getLogger(Diary.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  159.         }
  160.         catch (IllegalAccessException ex)
  161.         {
  162.             java.util.logging.Logger.getLogger(Diary.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  163.         }
  164.         catch (javax.swing.UnsupportedLookAndFeelException ex)
  165.         {
  166.             java.util.logging.Logger.getLogger(Diary.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  167.         }
  168.         //</editor-fold>
  169.         //</editor-fold>
  170.  
  171.         /* Create and display the form */
  172.         java.awt.EventQueue.invokeLater(new Runnable()
  173.         {
  174.             public void run()
  175.             {
  176.                 new Diary().setVisible(true);
  177.             }
  178.         });
  179.     }
  180.  
  181.     // Variables declaration - do not modify
  182.     private javax.swing.JButton continueButton;
  183.     private javax.swing.JLabel continueLabel;
  184.     private javax.swing.JLabel diaryLabel;
  185.     private javax.swing.JButton exitButton;
  186.     private javax.swing.JLabel welcomeLabel;
  187.     // End of variables declaration
  188. }
Add Comment
Please, Sign In to add comment