Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package diary;
- import java.awt.Color;
- /**
- *
- * @author root
- */
- public class Diary extends javax.swing.JFrame
- {
- /**
- * Creates new form Menu
- */
- public Diary()
- {
- initComponents();
- getContentPane().setBackground(Color.BLACK);
- }
- /**
- * This method is called from within the constructor to initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is always
- * regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">
- private void initComponents()
- {
- welcomeLabel = new javax.swing.JLabel();
- diaryLabel = new javax.swing.JLabel();
- continueLabel = new javax.swing.JLabel();
- continueButton = new javax.swing.JButton();
- exitButton = new javax.swing.JButton();
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- welcomeLabel.setFont(new java.awt.Font("Microsoft YaHei", 1, 12)); // NOI18N
- welcomeLabel.setForeground(new java.awt.Color(0, 153, 255));
- welcomeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- welcomeLabel.setText("WELCOME");
- diaryLabel.setFont(new java.awt.Font("Lucida Handwriting", 1, 12)); // NOI18N
- diaryLabel.setForeground(new java.awt.Color(255, 0, 102));
- diaryLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- diaryLabel.setText("THIS IS YOUR PERSONAL DIARY");
- continueLabel.setFont(new java.awt.Font("Kristen ITC", 1, 12)); // NOI18N
- continueLabel.setForeground(new java.awt.Color(51, 204, 0));
- continueLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- continueLabel.setText("CLICK 'CONTINUE' TO USE THIS APP");
- continueButton.setBackground(new java.awt.Color(51, 51, 51));
- continueButton.setFont(new java.awt.Font("Papyrus", 1, 12)); // NOI18N
- continueButton.setForeground(new java.awt.Color(0, 255, 255));
- continueButton.setText("CONTINUE");
- continueButton.addActionListener(new java.awt.event.ActionListener()
- {
- public void actionPerformed(java.awt.event.ActionEvent evt)
- {
- continueButtonActionPerformed(evt);
- }
- });
- exitButton.setBackground(new java.awt.Color(51, 51, 51));
- exitButton.setFont(new java.awt.Font("Papyrus", 1, 12)); // NOI18N
- exitButton.setForeground(new java.awt.Color(255, 255, 0));
- exitButton.setText("EXIT");
- exitButton.addActionListener(new java.awt.event.ActionListener()
- {
- public void actionPerformed(java.awt.event.ActionEvent evt)
- {
- exitButtonActionPerformed(evt);
- }
- });
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(continueLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(exitButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(continueButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(diaryLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(welcomeLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 390, Short.MAX_VALUE))
- .addContainerGap())
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(welcomeLabel)
- .addGap(18, 18, 18)
- .addComponent(diaryLabel)
- .addGap(18, 18, 18)
- .addComponent(continueLabel)
- .addGap(87, 87, 87)
- .addComponent(continueButton)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE)
- .addComponent(exitButton)
- .addContainerGap())
- );
- pack();
- setLocationRelativeTo(null);
- }// </editor-fold>
- private void exitButtonActionPerformed(java.awt.event.ActionEvent evt)
- {
- // TODO add your handling code here:
- System.exit(0);
- }
- private void continueButtonActionPerformed(java.awt.event.ActionEvent evt)
- {
- // TODO add your handling code here:
- this.setVisible(false);
- Menu menu = new Menu();
- menu.setVisible(true);
- }
- /**
- * @param args the command line arguments
- */
- public static void main(String args[])
- {
- /* Set the Nimbus look and feel */
- //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
- /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
- * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
- */
- try
- {
- for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
- {
- if ("Nimbus".equals(info.getName()))
- {
- javax.swing.UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- }
- catch (ClassNotFoundException ex)
- {
- java.util.logging.Logger.getLogger(Diary.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- catch (InstantiationException ex)
- {
- java.util.logging.Logger.getLogger(Diary.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- catch (IllegalAccessException ex)
- {
- java.util.logging.Logger.getLogger(Diary.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- catch (javax.swing.UnsupportedLookAndFeelException ex)
- {
- java.util.logging.Logger.getLogger(Diary.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- //</editor-fold>
- //</editor-fold>
- /* Create and display the form */
- java.awt.EventQueue.invokeLater(new Runnable()
- {
- public void run()
- {
- new Diary().setVisible(true);
- }
- });
- }
- // Variables declaration - do not modify
- private javax.swing.JButton continueButton;
- private javax.swing.JLabel continueLabel;
- private javax.swing.JLabel diaryLabel;
- private javax.swing.JButton exitButton;
- private javax.swing.JLabel welcomeLabel;
- // End of variables declaration
- }
Add Comment
Please, Sign In to add comment