Estou criando um sistema de cadastro e me deparei com este erro:
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to modelo.Cliente
at visao.GUICadPedido.cadastrar(GUICadPedido.java:222)
at visao.GUICadPedido.jbCadastrarActionPerformed(GUICadPedido.java:244)
at visao.GUICadPedido.access$000(GUICadPedido.java:22)
at visao.GUICadPedido$1.actionPerformed(GUICadPedido.java:139)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
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:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Estou tentando fazer um cast de objeto Cliente para String, só que na hora de cadastrar o cliente acontece este erro. Já tentei inúmeras soluções e não consegui nada. 
Classe Pedido
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package modelo;
/**
*
* @author Antonio Guilherme
* @since 07/05/2019 - 11:23
* @version 1.0 Beta Shen
*/
public class Pedido {
private long idPedido;
private String hamburguer;
private String bebida;
private String batata;
private String sobremesa;
private Cliente cliente;
public Pedido() {
}
public Pedido(long idPedido, String hamburguer, String bebida, String batata, String sobremesa, Cliente cliente) {
this.idPedido = idPedido;
this.hamburguer = hamburguer;
this.bebida = bebida;
this.batata = batata;
this.sobremesa = sobremesa;
this.cliente = cliente;
}
public long getIdPedido() {
return idPedido;
}
public void setIdPedido(long idPedido) {
this.idPedido = idPedido;
}
public String getHamburguer() {
return hamburguer;
}
public void setHamburguer(String hamburguer) {
this.hamburguer = hamburguer;
}
public String getBebida() {
return bebida;
}
public void setBebida(String bebida) {
this.bebida = bebida;
}
public String getBatata() {
return batata;
}
public void setBatata(String batata) {
this.batata = batata;
}
public String getSobremesa() {
return sobremesa;
}
public void setSobremesa(String sobremesa) {
this.sobremesa = sobremesa;
}
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
public double calcularTotal(){
double cheddar = 7;
double bigmac = 9;
double quarteirao = 8;
double pequena = 4;
double media = 5;
double grande = 7;
double agua = 3;
double refrigerante = 5;
double suco = 7;
double casquinha = 2;
double mccolosso = 6;
double mcflurry = 8;
if(hamburguer.equals("Cheddar") && batata.equals("Pequena") && bebida.equals("Água") && sobremesa.equals("Casquinha")){
return cheddar + pequena + agua + casquinha;
}
if(hamburguer.equals("BigMac") && batata.equals("Média") && bebida.equals("Refrigerante") && sobremesa.equals("McColosso")){
return bigmac + media + refrigerante + mccolosso;
}
if(hamburguer.equals("Quarteirão") && batata.equals("Grande") && bebida.equals("Suco") && sobremesa.equals("McFlurry")){
return quarteirao + grande + suco + mcflurry;
}
return 0;
}
@Override
public String toString() {
return "Pedido{" + "idPedido=" + idPedido + ", hamburguer=" + hamburguer + ", bebida=" + bebida + ", batata=" + batata + ", sobremesa=" + sobremesa + ", cliente=" + cliente + '}';
}
}
Classe Cliente
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package modelo;
/**
*
* @author Antonio Guilherme
* @since 07/05/2019 - 11:38
* @version 1.0 Beta Shen
*/
public class Cliente {
private long idCliente;
private String nome;
private int idade;
private long cpf;
private int fone;
private String email;
public Cliente() {
}
public Cliente(long idCliente, String nome, int idade, long cpf, int fone, String email) {
this.idCliente = idCliente;
this.nome = nome;
this.idade = idade;
this.cpf = cpf;
this.fone = fone;
this.email = email;
}
public long getIdCliente() {
return idCliente;
}
public void setIdCliente(long idCliente) {
this.idCliente = idCliente;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public int getIdade() {
return idade;
}
public void setIdade(int idade) {
this.idade = idade;
}
public long getCpf() {
return cpf;
}
public void setCpf(long cpf) {
this.cpf = cpf;
}
public int getFone() {
return fone;
}
public void setFone(int fone) {
this.fone = fone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return nome;
}
}
Classe GUICadPedido
private void preencherCombo(){
try {
ClienteServicos cs = ServicosFactory.getClienteServicos();
ArrayList<Cliente> c = cs.buscarClientes();
for(int i=0 ; i<c.size() ; i++) {
jcbCliente.addItem(c.get(i)+"");
}
} catch (Exception e) {
JOptionPane.showMessageDialog(
this,
"Erro! "+e.getMessage());
}
}
private void cadastrar(){
try{
Pedido p = new Pedido();
p.setHamburguer(jtHamburguer.getText());
p.setBatata(jtBatata.getText());
p.setBebida(jtBebida.getText());
p.setSobremesa(jtSobremesa.getText());
p.setCliente((Cliente)jcbCliente.getSelectedItem());
PedidoServicos ps = ServicosFactory.getPedidoServicos();
ps.cadastrarPedido(p);
JOptionPane.showMessageDialog(this,
"Pedido cadastrado com sucesso!");
}catch(SQLException e){
JOptionPane.showMessageDialog(this,
"Erro! "+e.getMessage());
}
}
OBS: Sou novo aqui, desculpa se formatar ou fizer algo errado.
OBS: Algumas coisas que talvez não estejam visíveis no código, mas que eu estava pensando na hora de programar: eu estava querendo mostrar a tabela Pedido com o nome do Cliente, mas acabei não conseguindo e decidi mostrar só o idCliente. Eu acho que nessa tentativa de querer fazer uma coisa e depois voltar atrás, acabei errando algo.