Boa tarde alguém sabe como eu posso ta resolvendo esse erro? Quando coloco pra rodar o projeto da esse aviso:
ant -f C:\\Users\\rfl\\Documents\\NetBeansProjects\\ProjetoLivraria2 -Dnb.internal.action.name=run -Ddirectory.deployment.supported=true -DforceRedeploy=false -Dbrowser.context=C:\\Users\\rfl\\Documents\\NetBeansProjects\\ProjetoLivraria2 -Dnb.wait.for.caches=true run
init:
deps-module-jar:
projetolivraria.init:
Deleting: C:\Users\rfl\Documents\NetBeansProjects\JavaApplication2\build\built-jar.properties
projetolivraria.deps-jar:
Updating property file: C:\Users\rfl\Documents\NetBeansProjects\JavaApplication2\build\built-jar.properties
Compiling 1 source file to C:\Users\rfl\Documents\NetBeansProjects\JavaApplication2\build\classes
C:\Users\rfl\Documents\NetBeansProjects\JavaApplication2\src\projetolivraria\view\ManterCompras.java:44: error: no suitable constructor found for Compras(String)
Compras compEnt = new Compras(obs);
constructor Compras.Compras(double,int,int,String,String,String) is not applicable
(actual and formal argument lists differ in length)
constructor Compras.Compras(double,int,int,int,String,String,String) is not applicable
(actual and formal argument lists differ in length)
constructor Compras.Compras(int,double,int,int,String,String,String) is not applicable
(actual and formal argument lists differ in length)
C:\Users\rfl\Documents\NetBeansProjects\JavaApplication2\src\projetolivraria\view\ManterCompras.java:58: error: no suitable constructor found for Compras(int)
Compras compEnt = new Compras(id);
constructor Compras.Compras(double,int,int,String,String,String) is not applicable
(actual and formal argument lists differ in length)
constructor Compras.Compras(double,int,int,int,String,String,String) is not applicable
(actual and formal argument lists differ in length)
constructor Compras.Compras(int,double,int,int,String,String,String) is not applicable
(actual and formal argument lists differ in length)
C:\Users\rfl\Documents\NetBeansProjects\JavaApplication2\src\projetolivraria\view\ManterCompras.java:66: error: no suitable constructor found for Compras(int)
Compras compEntrada = new Compras(id);
constructor Compras.Compras(double,int,int,String,String,String) is not applicable
(actual and formal argument lists differ in length)
constructor Compras.Compras(double,int,int,int,String,String,String) is not applicable
(actual and formal argument lists differ in length)
constructor Compras.Compras(int,double,int,int,String,String,String) is not applicable
(actual and formal argument lists differ in length)
3 errors
BUILD FAILED (total time: 3 seconds)
package projetolivraria.view;
import javax.swing.JOptionPane;
import projetolivraria.controllers.ControllerCompras;
import java.sql.SQLException;
import java.util.List;
import projetolivraria.models.beans.Compras;
public class ManterCompras {
static ControllerCompras contcomp;
public static void inserir() throws SQLException, ClassNotFoundException {
double valor_total = Double.parseDouble(JOptionPane.showInputDialog("Valor Total"));
int id_livros = Integer.parseInt(JOptionPane.showInputDialog("ID livros"));
int id_clientes = Integer.parseInt(JOptionPane.showInputDialog("ID Clientes"));
String dtini = JOptionPane.showInputDialog("DT_INI");
String dtfim = JOptionPane.showInputDialog("DT_FIM");
String obs = JOptionPane.showInputDialog("OBS");
Compras compEnt = new Compras(valor_total, id_livros, id_clientes, dtini, dtfim, obs);
contcomp = new ControllerCompras();
Compras compSaida = contcomp.inserir(compEnt);
JOptionPane.showMessageDialog(null, compSaida.toString());
}
public static void alterar() throws SQLException, ClassNotFoundException {
int id = Integer.parseInt(JOptionPane.showInputDialog("ID"));
double valor_total = Double.parseDouble(JOptionPane.showInputDialog("Valor Total"));
int id_livros = Integer.parseInt(JOptionPane.showInputDialog("ID livros"));
int id_clientes = Integer.parseInt(JOptionPane.showInputDialog("ID Clientes"));
String dtini = JOptionPane.showInputDialog("DT_INI");
String dtfim = JOptionPane.showInputDialog("DT_FIM");
String obs = JOptionPane.showInputDialog("OBS");
Compras compEnt = new Compras(id, valor_total, id_livros, id_clientes,dtini, dtfim, obs);
contcomp = new ControllerCompras();
Compras compSaida = contcomp.alterar(compEnt);
JOptionPane.showMessageDialog(null, compSaida.toString());
}
//listar compras
public static void listar() throws SQLException, ClassNotFoundException {
try {
String obs = JOptionPane.showInputDialog("OBS");
Compras compEnt = new Compras(obs);
contcomp = new ControllerCompras();
List<Compras> listacompSaida = contcomp.listar(compEnt);
for (Compras comp : listacompSaida) {
JOptionPane.showMessageDialog(null, comp.toString());
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e.getMessage(), "", JOptionPane.ERROR_MESSAGE);
}
}
public static void buscar() throws SQLException, ClassNotFoundException {
int id = Integer.parseInt(JOptionPane.showInputDialog("ID"));
Compras compEnt = new Compras(id);
contcomp = new ControllerCompras();
Compras compSaida = contcomp.buscar(compEnt);
JOptionPane.showMessageDialog(null, compSaida.toString());
}
public static void excluir() throws SQLException, ClassNotFoundException {
int id = Integer.parseInt(JOptionPane.showInputDialog("ID"));
Compras compEntrada = new Compras(id);
contcomp = new ControllerCompras();
Compras compSaida = contcomp.excluir(compEntrada);
JOptionPane.showMessageDialog(null, compSaida.toString());
}
public static void menu() throws SQLException, ClassNotFoundException {
int operacao = Integer.parseInt(JOptionPane.showInputDialog("0 - Sair \n 1 - Inserir \n 2 - Alterar \n 3 - Excluir \n 4 - Buscar \n 5 - Listar"));
switch (operacao) {
case 0:
int sair = JOptionPane.showConfirmDialog(null, "Deseja Sair");
System.out.println("Valor de Sair = " + sair);
if (sair > 0) {
menu();
}
break;
case 1:
inserir();
break;
case 2:
alterar();
break;
case 3:
excluir();
break;
case 4:
buscar();
break;
case 5:
listar();
break;
default:
JOptionPane.showMessageDialog(null, "Erro opcao invalida");
menu();
break;
}
}
}