Doubt about Insert, Query, Class BD

Asked

Viewed 68 times

0

good night. I am developing a college job, which asked me to create a Student class, implement a graphical interface, with name, address, course options, list of choice and etc, and I made button to exit, consult and record.

Componente Interface Gráfica However, the question asks me to create a Bdstudent class that implements a Collection to group a set of Students objects and manipulate them, but I don’t know how to do this.

Someone can help me?

Basically, take this information and play for the Bdstudent class:

  private void jGravarActionPerformed(java.awt.event.ActionEvent evt) {                                        
        this.txtCidade.setEnabled(true);
        this.jConsultar.setEnabled(false);
        this.jSair.setEnabled(true);
        this.jGravar.setEnabled(false);
        String Nome = txtNome.getText();
        String Endereco = txtEndereco.getText();
        String Cidade = txtCidade.getText();
        String Estado = jEstado.getUIClassID();
        String Sexo ="";
            if(rdMasculino.isSelected()){
                Sexo = "Masculino";
}
            if(rdFeminino.isSelected()){
                Sexo = "Feminino";
}


            BDAluno bda = new BDAluno();

            if( bda.Gravar(Nome, Endereco, Cidade, Estado, Sexo) ) {
            JOptionPane.showMessageDialog(null, "Cadastro Realizado com Sucesso");

        int opcao = Integer.parseInt(JOptionPane.showInputDialog("Deseja realizar outro cadastro?:\n1 - Sim\n2 - Não e sair do programa"));

        switch (opcao) {
            case 1:
            initComponents();
            break;
            case 2:
            System.exit(0);
            break;
            default:
            JOptionPane.showMessageDialog(null, "Opção inválida.");
            break;
  • Provide a [mcve] what you’ve done so far to help you.

  • Where is the class Student?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.