Ola, estou desenvolvento um sistema para pedido de restaurante e quando eu clico no botao para abrir o outro Jframe aparece um msg de erro
Erro: java.lang.NullPointerException
Exception in thread “AWT-EventQueue-0” java.lang.IllegalArgumentException: adding a window to a container
PrincipalClienteForm
package com.xpto.cliente.view;
import java.awt.Container;
public class PrincipalClienteForm extends javax.swing.JFrame {
private Container PrincipalClienteForm;
public PrincipalClienteForm() {
PrincipalClienteForm = getContentPane();
initComponents();
}
private void BtnPratosPrincipalActionPerformed(java.awt.event.ActionEvent evt) {
PrincipalClienteForm.add(BtnPratosPrincipal);
PedidosClienteForm pcf = new PedidosClienteForm();
add(pcf);
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new PrincipalClienteForm().setVisible(true);
}
});
}
private javax.swing.JButton BtnChamar;
private javax.swing.JButton BtnEncerrar;
private javax.swing.JButton BtnListar;
private javax.swing.JButton BtnPratosPrincipal;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JTextField jTextField1;
// End of variables declaration
private static final long serialVersionUID = 1L;
}
PedidosClienteForm
public class PedidosClienteForm extends javax.swing.JFrame {
/** Creates new form PratosClienteForm */
public PedidosClienteForm() {
initComponents();
setVisible(true);
setLocation(100, 100);
}
private void BtnBebidasActionPerformed(java.awt.event.ActionEvent evt) {
PedidosBebidasClienteForm pec = new PedidosBebidasClienteForm();
add(pec);
}
private void BtnAcompanhamentosActionPerformed(java.awt.event.ActionEvent evt) {
PedidosAcompanhamentosClienteForm ppc = new PedidosAcompanhamentosClienteForm();
add(ppc);
}
private void BtnSanduichesActionPerformed(java.awt.event.ActionEvent evt) {
PedidosSanduichesClienteForm psc = new PedidosSanduichesClienteForm();
add(psc);
}
private javax.swing.JButton BtnAcompanhamentos;
private javax.swing.JButton BtnBebidas;
private javax.swing.JButton BtnChamar;
private javax.swing.JButton BtnEncerrar;
private javax.swing.JButton BtnListar;
private javax.swing.JButton BtnSanduiches;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JTextField jTextField1;
// End of variables declaration
private static final long serialVersionUID = 1L;
}
Alguem poderia me orientar em achar o erro?
Obrigado