Pessoal,
estou com um problema ao utilizar o netbeans 6 quando utiliza nome completos das classes, exemplo do código abaixo, porém quando tiro o nome completo da classe e declaro o import em cima funciona, como resolver isso??? teria alguma configuração para fazer com que o código gerado pelo netbeans seja automaticamente adicionando os imports acima ???
ambiente:
-windows vista
-java 1.6.0_02
netbeans 6.0 M10
package auladesktop;
public class SegundaJanela extends javax.swing.JFrame {
/** Creates new form SegundaJanela */
public SegundaJanela() {
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.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton1.setText("jButton1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(66, 66, 66)
.addComponent(jButton1)
.addContainerGap(261, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(37, 37, 37)
.addComponent(jButton1)
.addContainerGap(240, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
System.out.println("teste");
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new SegundaJanela().setVisible(true);
}
});
}
// Variables declaration - do not modify
// Variables declaration - do not modify
javax.swing.JButton jButton1;
// End of variables declaration
}
[color=red]ERRO:
D:\java\projetos\pos\desktop\aula01\src\auladesktop\SegundaJanela.java:59: cannot find symbol
symbol : class awt
location: class auladesktop.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
D:\java\projetos\pos\desktop\aula01\src\auladesktop\SegundaJanela.java:33: cannot find symbol
symbol : class awt
location: class auladesktop.java
jButton1.addActionListener(new java.awt.event.ActionListener() {
D:\java\projetos\pos\desktop\aula01\src\auladesktop\SegundaJanela.java:67: cannot find symbol
symbol : variable awt
location: class auladesktop.java
java.awt.EventQueue.invokeLater(new Runnable() {[/color]