Guest User

Tela de Cadastro

a guest
Mar 15th, 2020
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 18.14 KB | None | 0 0
  1. package viewLogin;
  2.  
  3. public class TelaCadastro extends javax.swing.JFrame
  4. {
  5.     public TelaCadastro()
  6.     {
  7.         initComponents();
  8.     }
  9.  
  10.  
  11.     @SuppressWarnings("unchecked")
  12.     // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  13.     private void initComponents() {
  14.  
  15.         jPanel1 = new javax.swing.JPanel();
  16.         jLabel4 = new javax.swing.JLabel();
  17.         jLabel5 = new javax.swing.JLabel();
  18.         txtCod = new javax.swing.JTextField();
  19.         txtTit = new javax.swing.JTextField();
  20.         jLabel1 = new javax.swing.JLabel();
  21.         jLabel2 = new javax.swing.JLabel();
  22.         txtAut = new javax.swing.JTextField();
  23.         txtNumero = new javax.swing.JComboBox<>();
  24.         jLabel3 = new javax.swing.JLabel();
  25.         jScrollPane1 = new javax.swing.JScrollPane();
  26.         jTextArea1 = new javax.swing.JTextArea();
  27.         jLabel6 = new javax.swing.JLabel();
  28.         jRadioButton1 = new javax.swing.JRadioButton();
  29.         jRadioButton2 = new javax.swing.JRadioButton();
  30.         jRadioButton3 = new javax.swing.JRadioButton();
  31.         jRadioButton4 = new javax.swing.JRadioButton();
  32.         jRadioButton5 = new javax.swing.JRadioButton();
  33.         jButton1 = new javax.swing.JButton();
  34.         jButton2 = new javax.swing.JButton();
  35.  
  36.         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  37.         setTitle("TELA DE CADASTRO");
  38.         setResizable(false);
  39.  
  40.         jPanel1.setForeground(new java.awt.Color(255, 51, 51));
  41.  
  42.         jLabel4.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  43.         jLabel4.setForeground(new java.awt.Color(255, 0, 0));
  44.         jLabel4.setText("Código");
  45.  
  46.         jLabel5.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  47.         jLabel5.setForeground(new java.awt.Color(255, 0, 0));
  48.         jLabel5.setText("Titulo");
  49.  
  50.         txtCod.addActionListener(new java.awt.event.ActionListener() {
  51.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  52.                 txtCodActionPerformed(evt);
  53.             }
  54.         });
  55.  
  56.         txtTit.addActionListener(new java.awt.event.ActionListener() {
  57.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  58.                 txtTitActionPerformed(evt);
  59.             }
  60.         });
  61.  
  62.         jLabel1.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  63.         jLabel1.setForeground(new java.awt.Color(255, 0, 0));
  64.         jLabel1.setText("Autor");
  65.  
  66.         jLabel2.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  67.         jLabel2.setForeground(new java.awt.Color(255, 0, 0));
  68.         jLabel2.setText("Edicao");
  69.  
  70.         txtNumero.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  71.         txtNumero.setForeground(new java.awt.Color(0, 102, 255));
  72.         txtNumero.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "<Selecione uma das opcoes>", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
  73.         txtNumero.addActionListener(new java.awt.event.ActionListener() {
  74.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  75.                 txtNumeroActionPerformed(evt);
  76.             }
  77.         });
  78.  
  79.         jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  80.         jLabel3.setForeground(new java.awt.Color(255, 0, 0));
  81.         jLabel3.setText("Citacao");
  82.  
  83.         jTextArea1.setColumns(20);
  84.         jTextArea1.setRows(5);
  85.         jScrollPane1.setViewportView(jTextArea1);
  86.  
  87.         jLabel6.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  88.         jLabel6.setForeground(new java.awt.Color(255, 0, 0));
  89.         jLabel6.setText("Genero");
  90.  
  91.         jRadioButton1.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  92.         jRadioButton1.setForeground(new java.awt.Color(0, 51, 204));
  93.         jRadioButton1.setText("romance");
  94.         jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
  95.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  96.                 jRadioButton1ActionPerformed(evt);
  97.             }
  98.         });
  99.  
  100.         jRadioButton2.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  101.         jRadioButton2.setForeground(new java.awt.Color(0, 51, 204));
  102.         jRadioButton2.setText("terror");
  103.  
  104.         jRadioButton3.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  105.         jRadioButton3.setForeground(new java.awt.Color(0, 51, 204));
  106.         jRadioButton3.setText("Ficcao");
  107.  
  108.         jRadioButton4.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  109.         jRadioButton4.setForeground(new java.awt.Color(0, 51, 204));
  110.         jRadioButton4.setText("Drama ");
  111.         jRadioButton4.addActionListener(new java.awt.event.ActionListener() {
  112.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  113.                 jRadioButton4ActionPerformed(evt);
  114.             }
  115.         });
  116.  
  117.         jRadioButton5.setFont(new java.awt.Font("Times New Roman", 0, 13)); // NOI18N
  118.         jRadioButton5.setForeground(new java.awt.Color(0, 51, 204));
  119.         jRadioButton5.setText("Biografia");
  120.  
  121.         jButton1.setForeground(new java.awt.Color(0, 153, 102));
  122.         jButton1.setText("SALVAR");
  123.  
  124.         jButton2.setFont(new java.awt.Font("Times New Roman", 1, 13)); // NOI18N
  125.         jButton2.setForeground(new java.awt.Color(0, 51, 51));
  126.         jButton2.setText("SAIR");
  127.  
  128.         javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
  129.         jPanel1.setLayout(jPanel1Layout);
  130.         jPanel1Layout.setHorizontalGroup(
  131.             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  132.             .addGroup(jPanel1Layout.createSequentialGroup()
  133.                 .addContainerGap()
  134.                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  135.                     .addGroup(jPanel1Layout.createSequentialGroup()
  136.                         .addComponent(jLabel3)
  137.                         .addGap(309, 309, 309)
  138.                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  139.                             .addComponent(jRadioButton2)
  140.                             .addComponent(jRadioButton3))
  141.                         .addGap(0, 0, Short.MAX_VALUE))
  142.                     .addGroup(jPanel1Layout.createSequentialGroup()
  143.                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  144.                             .addGroup(jPanel1Layout.createSequentialGroup()
  145.                                 .addComponent(txtCod, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
  146.                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  147.                                 .addComponent(txtTit))
  148.                             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
  149.                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  150.                                     .addComponent(jLabel1)
  151.                                     .addComponent(txtAut, javax.swing.GroupLayout.PREFERRED_SIZE, 328, javax.swing.GroupLayout.PREFERRED_SIZE))
  152.                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  153.                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  154.                                     .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
  155.                                     .addComponent(txtNumero, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)))
  156.                             .addGroup(jPanel1Layout.createSequentialGroup()
  157.                                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  158.                                     .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
  159.                                         .addGroup(jPanel1Layout.createSequentialGroup()
  160.                                             .addGap(10, 10, 10)
  161.                                             .addComponent(jButton1)
  162.                                             .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  163.                                             .addComponent(jButton2))
  164.                                         .addGroup(jPanel1Layout.createSequentialGroup()
  165.                                             .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
  166.                                             .addGap(198, 198, 198)
  167.                                             .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  168.                                                 .addComponent(jRadioButton4)
  169.                                                 .addComponent(jRadioButton5)
  170.                                                 .addComponent(jLabel6)
  171.                                                 .addComponent(jRadioButton1))))
  172.                                     .addGroup(jPanel1Layout.createSequentialGroup()
  173.                                         .addComponent(jLabel4)
  174.                                         .addGap(97, 97, 97)
  175.                                         .addComponent(jLabel5)))
  176.                                 .addGap(0, 24, Short.MAX_VALUE)))
  177.                         .addContainerGap())))
  178.         );
  179.         jPanel1Layout.setVerticalGroup(
  180.             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  181.             .addGroup(jPanel1Layout.createSequentialGroup()
  182.                 .addContainerGap()
  183.                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  184.                     .addComponent(jLabel4)
  185.                     .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
  186.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  187.                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  188.                     .addGroup(jPanel1Layout.createSequentialGroup()
  189.                         .addComponent(txtCod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  190.                         .addGap(18, 18, 18)
  191.                         .addComponent(jLabel1)
  192.                         .addGap(2, 2, 2)
  193.                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  194.                             .addComponent(txtAut, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  195.                             .addComponent(txtNumero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
  196.                     .addGroup(jPanel1Layout.createSequentialGroup()
  197.                         .addComponent(txtTit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  198.                         .addGap(18, 18, 18)
  199.                         .addComponent(jLabel2)))
  200.                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  201.                     .addGroup(jPanel1Layout.createSequentialGroup()
  202.                         .addGap(13, 13, 13)
  203.                         .addComponent(jLabel3)
  204.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  205.                         .addComponent(jScrollPane1)
  206.                         .addGap(56, 56, 56))
  207.                     .addGroup(jPanel1Layout.createSequentialGroup()
  208.                         .addGap(22, 22, 22)
  209.                         .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
  210.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  211.                         .addComponent(jRadioButton1)
  212.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  213.                         .addComponent(jRadioButton2)
  214.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  215.                         .addComponent(jRadioButton3)
  216.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  217.                         .addComponent(jRadioButton4)
  218.                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  219.                         .addComponent(jRadioButton5)
  220.                         .addGap(18, 18, 18)
  221.                         .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  222.                             .addComponent(jButton2)
  223.                             .addComponent(jButton1))
  224.                         .addGap(0, 16, Short.MAX_VALUE))))
  225.         );
  226.  
  227.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  228.         getContentPane().setLayout(layout);
  229.         layout.setHorizontalGroup(
  230.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  231.             .addGroup(layout.createSequentialGroup()
  232.                 .addContainerGap()
  233.                 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  234.                 .addContainerGap())
  235.         );
  236.         layout.setVerticalGroup(
  237.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  238.             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  239.                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  240.                 .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  241.                 .addContainerGap())
  242.         );
  243.  
  244.         pack();
  245.     }// </editor-fold>                        
  246.  
  247.     private void txtTitActionPerformed(java.awt.event.ActionEvent evt) {                                      
  248.         // TODO add your handling code here:
  249.     }                                      
  250.  
  251.     private void txtNumeroActionPerformed(java.awt.event.ActionEvent evt) {                                          
  252.    
  253.      
  254.     }                                        
  255.  
  256.     private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                              
  257.         // TODO add your handling code here:
  258.     }                                            
  259.  
  260.     private void txtCodActionPerformed(java.awt.event.ActionEvent evt) {                                      
  261.         // TODO add your handling code here:
  262.     }                                      
  263.  
  264.     private void jRadioButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                              
  265.         // TODO add your handling code here:
  266.     }                                            
  267.  
  268.     /**
  269.      * @param args the command line arguments
  270.      */
  271.     public static void main(String args[]) {
  272.         /* Set the Nimbus look and feel */
  273.         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  274.         /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  275.          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  276.          */
  277.         try {
  278.             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  279.                 if ("Nimbus".equals(info.getName())) {
  280.                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
  281.                     break;
  282.                 }
  283.             }
  284.         } catch (ClassNotFoundException ex) {
  285.             java.util.logging.Logger.getLogger(TelaCadastro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  286.         } catch (InstantiationException ex) {
  287.             java.util.logging.Logger.getLogger(TelaCadastro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  288.         } catch (IllegalAccessException ex) {
  289.             java.util.logging.Logger.getLogger(TelaCadastro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  290.         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  291.             java.util.logging.Logger.getLogger(TelaCadastro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  292.         }
  293.         //</editor-fold>
  294.         //</editor-fold>
  295.  
  296.         /* Create and display the form */
  297.         java.awt.EventQueue.invokeLater(new Runnable() {
  298.             public void run() {
  299.                 new TelaCadastro().setVisible(true);
  300.             }
  301.         });
  302.     }
  303.  
  304.     // Variables declaration - do not modify                    
  305.     private javax.swing.JButton jButton1;
  306.     private javax.swing.JButton jButton2;
  307.     private javax.swing.JLabel jLabel1;
  308.     private javax.swing.JLabel jLabel2;
  309.     private javax.swing.JLabel jLabel3;
  310.     private javax.swing.JLabel jLabel4;
  311.     private javax.swing.JLabel jLabel5;
  312.     private javax.swing.JLabel jLabel6;
  313.     private javax.swing.JPanel jPanel1;
  314.     private javax.swing.JRadioButton jRadioButton1;
  315.     private javax.swing.JRadioButton jRadioButton2;
  316.     private javax.swing.JRadioButton jRadioButton3;
  317.     private javax.swing.JRadioButton jRadioButton4;
  318.     private javax.swing.JRadioButton jRadioButton5;
  319.     private javax.swing.JScrollPane jScrollPane1;
  320.     private javax.swing.JTextArea jTextArea1;
  321.     private javax.swing.JTextField txtAut;
  322.     private javax.swing.JTextField txtCod;
  323.     private javax.swing.JComboBox<String> txtNumero;
  324.     private javax.swing.JTextField txtTit;
  325.     // End of variables declaration                  
  326. }
Advertisement
Add Comment
Please, Sign In to add comment