Estou fazendo um mini projeto de loja de video de cadastro e está dando erro na linha 228 a 284. o que pode estar errado
como fazer import para o botão funcionar?
/*
- To change this template, choose Tools | Templates
- and open the template in the editor.
*/
/*
- Locadora.java
- Created on May 27, 2011, 1:39:20 PM
*/
package Locadora;
/**
*
-
@author Fabio
*/
public class Locadora extends javax.swing.JFrame {/** Creates new form Locadora */ public Locadora() { initComponents(); }
/** 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”) // private void initComponents() {
jPanel1 = new javax.swing.JPanel(); jLnome = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); jTnome = new javax.swing.JTextPane(); jScrollPane2 = new javax.swing.JScrollPane(); jTnúmero = new javax.swing.JTextPane(); jLtelefone = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jScrollPane3 = new javax.swing.JScrollPane(); jTtitúlo = new javax.swing.JTextPane(); jScrollPane4 = new javax.swing.JScrollPane(); jTcategoria = new javax.swing.JTextPane(); jScrollPane5 = new javax.swing.JScrollPane(); jTgênero = new javax.swing.JTextPane(); jLabel6 = new javax.swing.JLabel(); jScrollPane6 = new javax.swing.JScrollPane(); jTator = new javax.swing.JTextPane(); jBnovo = new javax.swing.JButton(); jBaltera = new javax.swing.JButton(); jBexcluir = new javax.swing.JButton(); jBsalva = new javax.swing.JButton(); jBsair = new javax.swing.JButton(); jLabel7 = new javax.swing.JLabel(); jScrollPane9 = new javax.swing.JScrollPane(); jTtelefone = new javax.swing.JTextPane(); jLendereço = new javax.swing.JLabel(); jScrollPane10 = new javax.swing.JScrollPane(); jTendereço = new javax.swing.JTextPane(); jBpesquisa = new javax.swing.JButton(); jScrollPane7 = new javax.swing.JScrollPane(); jTpesquisa = new javax.swing.JTextPane(); jScrollPane8 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(“Cadastro de Cliente e Filmes”));jLnome.setText("Nome ");jLabel2.setText(“Número”);jScrollPane1.setViewportView(jTnome);jScrollPane2.setViewportView(jTnúmero);jLtelefone.setText(“Telefone”);jLabel4.setText(“Categoria”);jLabel5.setText(“Gênero”);jScrollPane3.setViewportView(jTtitúlo);jScrollPane4.setViewportView(jTcategoria);jScrollPane5.setViewportView(jTgênero);jLabel6.setText(“Ator”);jScrollPane6.setViewportView(jTator);jBnovo.setText(“Novo”); jBnovo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jBnovoActionPerformed(evt); } });
jBaltera.setText(“Altera”);jBexcluir.setText(“Excluir”);jBsalva.setText(“Salva”); jBsalva.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jBsalvaActionPerformed(evt); } });
jBsair.setText(“Sair”);jLabel7.setText(“Titúlo”);jScrollPane9.setViewportView(jTtelefone);jLendereço.setText(“Endereço”);jScrollPane10.setViewportView(jTendereço);javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap(323, Short.MAX_VALUE) .addComponent(jLtelefone) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLnome) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addComponent(jLendereço) .addGap(18, 18, 18) .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel7) .addGap(12, 12, 12) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(33, 33, 33)) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(98, 98, 98)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jBnovo) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jBaltera) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jBexcluir) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jBsalva) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jBsair) .addContainerGap(318, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(26, 26, 26) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLnome) .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLtelefone) .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLendereço) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(23, 23, 23) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel5) .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) .addGap(20, 20, 20) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel6)) .addGap(7, 7, 7) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jBnovo) .addComponent(jBaltera) .addComponent(jBexcluir) .addComponent(jBsalva) .addComponent(jBsair)) .addContainerGap()) );
jBpesquisa.setText(“Pesquisa”);jScrollPane7.setViewportView(jTpesquisa);jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { “Title 1”, “Title 2”, “Title 3”, “Title 4” } )); jScrollPane8.setViewportView(jTable1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 837, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jBpesquisa)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 908, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jBpesquisa) .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(60, Short.MAX_VALUE)) );
pack();
}//
private void jBnovoActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here: -
Locadora c1 = new Locadora();
c1.setnome(jTnome.getText()); ----------------------------------------------------------> Erro
c1.settelefone(jTtelefone.getText());
c1.setendereço(jTendereço.getText());
c1.setnúmero(jTnúmero.getText());
c1.setcategoria(jTcategoria.getText());
c1.setgênero(jTgênero.getText());
c1.setator(jTator.getText());
}
private void jBsalvaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
jTnome.setText("");
jTtelefone.setText("");
jTendereço.setText("");
jTnúmero.setText("");
jTtitúlo.setText("");
jTcategoria.setText("");
jTgênero.setText("");
jTator.setText("");
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Locadora().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jBaltera;
private javax.swing.JButton jBexcluir;
private javax.swing.JButton jBnovo;
private javax.swing.JButton jBpesquisa;
private javax.swing.JButton jBsair;
private javax.swing.JButton jBsalva;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLendereço;
private javax.swing.JLabel jLnome;
private javax.swing.JLabel jLtelefone;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane10;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JScrollPane jScrollPane5;
private javax.swing.JScrollPane jScrollPane6;
private javax.swing.JScrollPane jScrollPane7;
private javax.swing.JScrollPane jScrollPane8;
private javax.swing.JScrollPane jScrollPane9;
private javax.swing.JTable jTable1;
private javax.swing.JTextPane jTator;
private javax.swing.JTextPane jTcategoria;
private javax.swing.JTextPane jTendereço;
private javax.swing.JTextPane jTgênero;
private javax.swing.JTextPane jTnome;
private javax.swing.JTextPane jTnúmero;
private javax.swing.JTextPane jTpesquisa;
private javax.swing.JTextPane jTtelefone;
private javax.swing.JTextPane jTtitúlo;
// End of variables declaration
}