style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-5164839828746352"
data-ad-slot="7563230308">

Ayuda hacer una encuesta en java con clases

hola..porfavor necesito ayuda, tengo que entregar este proyecto para pasar de modulo..
hacer un sistema de encuestas donde:
a.Ingrese encuestas
b.llenar encuentas
c.resultados(%)
d.salir del sistema
Cada encuesta tiene n preguntas, cada pregunta tiene 3 opciones..y en cada encuenta hay doy encuestas diferentes(osea en a son dos encuestas y en b son dos encuentas)
necesito hacer con classes y con arreglos ayuda porfavor

Opciones de visualización de comentarios

Seleccione la forma que prefiera para mostrar los comentarios y haga clic en «Guardar las opciones» para activar los cambios.
Imagen de VictorManuel

Pondré algunas paginas

Pondré algunas paginas que te podrán servir ..

www.javaya.com.ar/detalleconcepto.php?codigo=80&inicio=

Este me gusto mas -->>>

http://www.aprenderaprogramar.com/index.php?option=com_content&view=arti...

Ahora para arreglos y eso, yo prefiero vectores y hashmap

http://aprenderaprogramar.com/index.php?option=com_content&view=article&...

Ahí velo haciendo, si te atoras avisa... Saludos!!

Este codigo es en donde yo

Este codigo es en donde yo estoy creando mi vista
package Vistas;

import com.mongodb.*;
import Controlador.ConectDB;
import com.mongodb.BasicDBObject;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.Mongo;
import com.mongodb.MongoClient;
import com.mongodb.MongoException;
import java.net.UnknownHostException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
*
* @author ABRAHAM
*/
public class Crea_Encuesta extends javax.swing.JFrame {
DefaultTableModel model = new DefaultTableModel();
DB db;
DBCollection tabla;

//DefaulTableModel model = new DefaulTableModel();

/**
* Creates new form Crea_Encuesta
*/
public Crea_Encuesta() {

try {
Mongo mongo = new Mongo ("localhost", 27017);
db=mongo.getDB("encuesta");
tabla =db.getCollection("tabla");

} catch (UnknownHostException ex) {
Logger.getLogger(Crea_Encuesta.class.getName()).log(Level.SEVERE, null, ex);
}

initComponents();
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
//
private void initComponents() {

jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
txtpre2 = new javax.swing.JTextField();
txtpre1 = new javax.swing.JTextField();
txtpre3 = new javax.swing.JTextField();
txtpre4 = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jLabel7 = new javax.swing.JLabel();
res1 = new javax.swing.JTextField();
res2 = new javax.swing.JTextField();
res3 = new javax.swing.JTextField();
res4 = new javax.swing.JTextField();
res7 = new javax.swing.JTextField();
res10 = new javax.swing.JTextField();
res5 = new javax.swing.JTextField();
res8 = new javax.swing.JTextField();
res11 = new javax.swing.JTextField();
res6 = new javax.swing.JTextField();
res9 = new javax.swing.JTextField();
res12 = new javax.swing.JTextField();
btnGuardar1 = new javax.swing.JButton();
btnMostrar1 = new javax.swing.JButton();
btnEliminar1 = new javax.swing.JButton();
btnGuardar2 = new javax.swing.JButton();
btnMostrar2 = new javax.swing.JButton();
btbEliminar2 = new javax.swing.JButton();
btnGuardar3 = new javax.swing.JButton();
btnGuardar4 = new javax.swing.JButton();
btnMostrar3 = new javax.swing.JButton();
btnEliminar3 = new javax.swing.JButton();
btnMostrar4 = new javax.swing.JButton();
btnEliminar4 = new javax.swing.JButton();
btnSalir = new javax.swing.JButton();
txtMostrar = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
JTabla = new javax.swing.JTable();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jLabel1.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N
jLabel1.setText("Encuestas ");

jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel2.setText("Pregunta 1: ");

jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel3.setText("Pregunta 2:");

jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel4.setText("Pregunta 3:");

jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel5.setText("Pregunta 4: ");

jLabel6.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel6.setText("PREGUNTAS");

jLabel7.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
jLabel7.setText("RESPUESTAS");

javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(res1)
.addComponent(res4)
.addComponent(res7)
.addComponent(res10, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(res8, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(res5, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(res2)
.addComponent(res11))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(res3, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE)
.addComponent(res6)
.addComponent(res9)
.addComponent(res12))
.addGap(33, 33, 33))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(206, Short.MAX_VALUE)
.addComponent(jLabel7)
.addGap(198, 198, 198))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(24, 24, 24)
.addComponent(jLabel7)
.addGap(51, 51, 51)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(res1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(res2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(res3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(28, 28, 28)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(res4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(res5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(res6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(29, 29, 29)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(res7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(res8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(res9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(30, 30, 30)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(res10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(res11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(res12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(34, Short.MAX_VALUE))
);

btnGuardar1.setText("GUARDAR");
btnGuardar1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnGuardar1ActionPerformed(evt);
}
});

btnMostrar1.setText("MOSTRAR");
btnMostrar1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnMostrar1ActionPerformed(evt);
}
});

btnEliminar1.setText("ELIMINAR");
btnEliminar1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnEliminar1ActionPerformed(evt);
}
});

btnGuardar2.setText("GUARDAR");
btnGuardar2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnGuardar2ActionPerformed(evt);
}
});

btnMostrar2.setText("MOSTRAR");
btnMostrar2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnMostrar2ActionPerformed(evt);
}
});

btbEliminar2.setText("ELIMINAR");
btbEliminar2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btbEliminar2ActionPerformed(evt);
}
});

btnGuardar3.setText("GUARDAR");
btnGuardar3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnGuardar3ActionPerformed(evt);
}
});

btnGuardar4.setText("GUARDAR");
btnGuardar4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnGuardar4ActionPerformed(evt);
}
});

btnMostrar3.setText("MOSTRAR");
btnMostrar3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnMostrar3ActionPerformed(evt);
}
});

btnEliminar3.setText("ELIMINAR");
btnEliminar3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnEliminar3ActionPerformed(evt);
}
});

btnMostrar4.setText("MOSTRAR");
btnMostrar4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnMostrar4ActionPerformed(evt);
}
});

btnEliminar4.setText("ELIMINAR");

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(49, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtpre4))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtpre3))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(txtpre2))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtpre1, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jLabel6)
.addGap(89, 89, 89)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnGuardar4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnMostrar4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnEliminar4))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnGuardar3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnMostrar3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnEliminar3))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnGuardar1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnMostrar1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnEliminar1))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnGuardar2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnMostrar2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btbEliminar2)))
.addContainerGap(22, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(27, 27, 27)
.addComponent(jLabel6)
.addGap(49, 49, 49)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtpre1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(txtpre2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(24, 24, 24)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(txtpre3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(35, 35, 35)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(txtpre4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(97, 97, 97)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnGuardar1)
.addComponent(btnMostrar1)
.addComponent(btnEliminar1))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnGuardar2)
.addComponent(btnMostrar2)
.addComponent(btbEliminar2))
.addGap(26, 26, 26)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnGuardar3)
.addComponent(btnMostrar3)
.addComponent(btnEliminar3))
.addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnGuardar4)
.addComponent(btnMostrar4)
.addComponent(btnEliminar4))))
.addGap(35, 35, 35))
);

btnSalir.setText("SALIR");
btnSalir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSalirActionPerformed(evt);
}
});

JTabla.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane1.setViewportView(JTabla);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1)
.addGap(546, 546, 546))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(121, 121, 121)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1050, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnSalir)))
.addGroup(layout.createSequentialGroup()
.addGap(330, 330, 330)
.addComponent(txtMostrar, javax.swing.GroupLayout.PREFERRED_SIZE, 373, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(20, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(26, 26, 26)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(124, 124, 124)
.addComponent(btnSalir))
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(35, 35, 35)
.addComponent(txtMostrar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(97, 97, 97))
);

pack();
}//

private void btnGuardar3ActionPerformed(java.awt.event.ActionEvent evt) {
BasicDBObject document = new BasicDBObject();
document.put("PREGUNTA: ", "'"+txtpre3.getText()+"'");
document.put("RESPUESTA 7:", " "+res7.getText()+" ");
document.put("RESPUESTA 8:", " "+res8.getText()+" ");
document.put("RESPUESTA 9:", " "+res9.getText()+" ");
tabla.insert(document);

// this.dispose();
// limpiar();

}

private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}

private void btnGuardar1ActionPerformed(java.awt.event.ActionEvent evt) {

BasicDBObject document = new BasicDBObject();
document.put("PREGUNTA: ", " "+txtpre1.getText()+" ");
document.put("RESPUESTA 1:", " "+res1.getText()+" ");
document.put("RESPUESTA 2:", " "+res2.getText()+" ");
document.put("RESPUESTA 3:", " "+res3.getText()+" ");
tabla.insert(document);
// this.dispose();
// limpiar();

}

private void btnMostrar1ActionPerformed(java.awt.event.ActionEvent evt) {

}

private void btnEliminar1ActionPerformed(java.awt.event.ActionEvent evt) {
BasicDBObject document = new BasicDBObject();

document.put("priority", "highest");

document.put("PREGUNTA 1: ", " "+txtpre1.getText()+" ");
document.put("RESPUESTA 1:", " "+res1.getText()+" ");
document.put("PREGUNTA 2: ", " "+txtpre2.getText()+" ");
document.put("RESPUESTA 2:", " "+res2.getText()+" ");
document.put("PREGUNTA 3: ", " "+txtpre3.getText()+" ");
document.put("RESPUESTA 3:", " "+res3.getText()+" ");
document.put("PREGUNTA 4: ", " "+txtpre4.getText()+" ");
document.put("RESPUESTA 4:", " "+res4.getText()+" ");

DBCursor cursor = tabla.find();
while (cursor.hasNext()) {
DBObject item = cursor.next();
tabla.remove(item);

}
}

private void btnGuardar2ActionPerformed(java.awt.event.ActionEvent evt) {

BasicDBObject document = new BasicDBObject();

document.put("PREGUNTA: ", "'"+txtpre2.getText()+"'");
document.put("RESPUESTA 4:", "'"+res4.getText()+"'");
document.put("RESPUESTA 5:", "'"+res5.getText()+"'");
document.put("RESPUESTA 6:", "'"+res6.getText()+"'");
tabla.insert(document); // TODO add your handling code here:
}

private void btnGuardar4ActionPerformed(java.awt.event.ActionEvent evt) {
BasicDBObject document = new BasicDBObject();
document.put("PREGUNTA: ", "'"+txtpre4.getText()+"'");
document.put("RESPUESTA 10:", "'"+res10.getText()+"'");
document.put("RESPUESTA 11:", "'"+res11.getText()+"'");
document.put("RESPUESTA 12:", "'"+res12.getText()+"'");
tabla.insert(document);
}

private void btnMostrar2ActionPerformed(java.awt.event.ActionEvent evt) {

// DBCursor cursor = tabla.find();
// while (cursor.hasNext()){
// JTabla.setText(JTabla.getText()+"\n" + cursor.next());
// }
}

private void btnMostrar3ActionPerformed(java.awt.event.ActionEvent evt) {
// DBCursor cursor = tabla.find();
// while (cursor.hasNext()){
// jTextArea1.setText(jTextArea1.getText()+"\n" + cursor.next());
// }
}

private void btnMostrar4ActionPerformed(java.awt.event.ActionEvent evt) {
// DBCursor cursor = tabla.find();
// while (cursor.hasNext()){
// jTextArea1.setText(jTextArea1.getText()+"\n" + cursor.next());
// }
}

private void btbEliminar2ActionPerformed(java.awt.event.ActionEvent evt) {

tabla.remove(new BasicDBObject().append("pregunta1", "?"));

//Eliminar campos cuya pregunta sean mayor pregunta2
BasicDBObject query2 = new BasicDBObject();
query2.put("pregunta2", new BasicDBObject("$gt", 65));
tabla.remove(query2);

}

private void btnEliminar3ActionPerformed(java.awt.event.ActionEvent evt) {

DBCollection collection = db.getCollection("?");
DBObject findDoc = new BasicDBObject("?",true);
collection.remove(findDoc);
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Crea_Encuesta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Crea_Encuesta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Crea_Encuesta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Crea_Encuesta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//

/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Crea_Encuesta().setVisible(true);
}
});
}

y este en mi carpeta de modelo.... Aclaro yo estoy utilizando MVC en java que es la separacion de carpetas y esta clase es donde estoy agregando mis get y set ...

public class Encuesta {

private String pregunta1;
private String pregunta2;
private String pregunta3;
private String pregunta4;

private String respuesta1;
private String respuesta2;
private String respuesta3;
private String respuesta4;

/**
* @return the pregunta1
*/
public String getPregunta1() {
return pregunta1;
}

/**
* @param pregunta1 the pregunta1 to set
*/
public void setPregunta1(String pregunta1) {
this.pregunta1 = pregunta1;
}

/**
* @return the pregunta2
*/
public String getPregunta2() {
return pregunta2;
}

/**
* @param pregunta2 the pregunta2 to set
*/
public void setPregunta2(String pregunta2) {
this.pregunta2 = pregunta2;
}

/**
* @return the pregunta3
*/
public String getPregunta3() {
return pregunta3;
}

/**
* @param pregunta3 the pregunta3 to set
*/
public void setPregunta3(String pregunta3) {
this.pregunta3 = pregunta3;
}

/**
* @return the pregunta4
*/
public String getPregunta4() {
return pregunta4;
}

/**
* @param pregunta4 the pregunta4 to set
*/
public void setPregunta4(String pregunta4) {
this.pregunta4 = pregunta4;
}

/**
* @return the respuesta1
*/
public String getRespuesta1() {
return respuesta1;
}

/**
* @param respuesta1 the respuesta1 to set
*/
public void setRespuesta1(String respuesta1) {
this.respuesta1 = respuesta1;
}

/**
* @return the respuesta2
*/
public String getRespuesta2() {
return respuesta2;
}

/**
* @param respuesta2 the respuesta2 to set
*/
public void setRespuesta2(String respuesta2) {
this.respuesta2 = respuesta2;
}

/**
* @return the respuesta3
*/
public String getRespuesta3() {
return respuesta3;
}

/**
* @param respuesta3 the respuesta3 to set
*/
public void setRespuesta3(String respuesta3) {
this.respuesta3 = respuesta3;
}

/**
* @return the respuesta4
*/
public String getRespuesta4() {
return respuesta4;
}

/**
* @param respuesta4 the respuesta4 to set
*/
public void setRespuesta4(String respuesta4) {
this.respuesta4 = respuesta4;
}

}

Imagen de javatlacati

Encuesta en Java

Pues más que encuesta el código que recientemente estoy haciendo que es similar es para tipo exámenes, espero a alguien le interese y guste contribuir :)

https://github.com/javatlacati/Quiz

style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-5164839828746352"
data-ad-slot="7563230308">