Good evening. I'm developing a college work, which asked me to create a Student class, implement a graphical interface, with name, address, course options, choice list and etc, and make it quit, query, and save button. p>
However,thequestionasksmetocreateaBDAlunoclassthatimplementsaCollectiontogroupasetofStudentobjectsandmanipulatesthem,butIdonotknowhowtodothat.
Cananyonehelpme?
Basically,getthisinformationandplayfortheBDAlunoclass:
privatevoidjGravarActionPerformed(java.awt.event.ActionEventevt){this.txtCidade.setEnabled(true);this.jConsultar.setEnabled(false);this.jSair.setEnabled(true);this.jGravar.setEnabled(false);StringNome=txtNome.getText();StringEndereco=txtEndereco.getText();StringCidade=txtCidade.getText();StringEstado=jEstado.getUIClassID();StringSexo="";
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;