Ola pessoal, estou com um problema nesse código:
private javax.swing.JButton getJButton3() {
if (jButton3 == null) {
jButton3 = new javax.swing.JButton();
jButton3.setText("Gera Danfe");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public ArrayList buscarArquivoPorNome(String palavra, String caminhoInicial){
ArrayList lista = new ArrayList();
try{
File arquivo = new File(caminhoInicial);
lista = buscar(arquivo, palavra, lista);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Caminho Inválido");
}
return lista;
}
public ArrayList buscar(File arquivo, String palavra, ArrayList lista) {
if (arquivo.isDirectory()) {
File[] subPastas = arquivo.listFiles();
for (int i = 0; i < subPastas.length; i++) {
lista = buscar(subPastas[i], palavra, lista);
if (arquivo.getName().equalsIgnoreCase(palavra)) lista.add(arquivo.getAbsolutePath());
else if (arquivo.getName().indexOf(palavra) > -1) lista.add(arquivo.getAbsolutePath());
}
}
else if (arquivo.getName().equalsIgnoreCase(palavra)) lista.add(arquivo.getAbsolutePath());
else if (arquivo.getName().indexOf(palavra) > -1) lista.add(arquivo.getAbsolutePath());
return lista;
}
});
}
return jButton3;
}
Existem mais botões, mas esse botão eu criei para o usuário digitar o nome do arquivo que ele queira achar, o que esta errado?
Obrigado por me ajudarem!
Se você puder dizer qual é o erro, fica muito mais fácil pra gente te ajudar 
quando clico no botão aparece o seguinte erro:
Exception in thread “AWT-EventQueue-0” java.lang.UnsupportedOperationException: Not supported yet.
at Editor$3.actionPerformed(Editor.java:107)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:696)
at java.awt.EventQueue$4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)
Que raio de ActionListener é esse que não implementa actionPerformed? Hein?
http://docs.oracle.com/javase/6/docs/api/java/awt/event/ActionListener.html#actionPerformed(java.awt.event.ActionEvent)
Provavelmente você está usando o Eclipse e não está dando a mínima para as indicações de erro de compilação que ele está fazendo para você. Quando você executa uma classe com erro de compilação, acontece de mostrar mensagens completamente bizarras.
ola,
Pessoal eu implantei o action performed…
public void actionPerformed(ActionEvent e) {
throw new UnsupportedOperationException("Not supported yet.");
}
});
}
return jButton3;
Porém continua com o mesmo erro…
Será que é porque teria que implantar mais para cima???