import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JRootPane;
import javax.swing.JTextArea;
public class Teste2 extends JFrame implements ActionListener{
JPanel p;
JPanel p2,p3,p4,p5;
JLabel lPergunta1,lPergunta2,lPergunta3,lPergunta4,lPergunta5,lPergunta6,lPergunta7,lPergunta8,lPergunta9,lPergunta10,lPergunta11,lPergunta12,lPergunta13,lPergunta14,lPergunta15,lPergunta16,lPergunta17,lPergunta18,lPergunta19,lPergunta20,lResposta;
JRadioButton rCerto,rErrado,r2Certo,r2Errado,r3Certo,r3Errado,r4Certo,r4Errado;
public Teste2 (){
super(“Teste Que tipo de cabeça você tem.”);
setSize(280,330);
getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
setUndecorated(true);
setLocation(250,250);
p=new JPanel();
p2 = new JPanel();
p3 = new JPanel();
p4 = new JPanel();
p5 = new JPanel();
lPergunta1=new JLabel (“1 - Censurar programas de televisão em que apareçam cenas de sexo e violência é uma dever do governo.”);
rCerto = new JRadioButton(“Certo”);
rErrado = new JRadioButton(“Errado”);
lPergunta2=new JLabel (“2 - O fornecimento de energia elétrica deveria ser de responsabilidade exclusiva do estado.”);
r2Certo = new JRadioButton(“Certo”);
r2Errado = new JRadioButton(“Errado”);
lPergunta3 = new JLabel(“3 - O sistema bancário deveria ser estatal.”);
r3Certo = new JRadioButton(“Certo”);
r3Errado = new JRadioButton(“Errado”);
lPergunta4 = new JLabel(“4 - Cabe ao governo cuidar do que é público.”);
r4Certo = new JRadioButton(“Certo”);
r4Errado = new JRadioButton(“Errado”);
p.setLayout(new GridLayout (4,2));
p2.setLayout(new GridLayout (4,2));
p3.setLayout(new GridLayout (4,2));
p4.setLayout(new GridLayout (4,2));
p.setLayout(new FlowLayout(FlowLayout.LEFT));
p.add(lPergunta1);
p.add(rCerto);
p.add(rErrado);
p2.add(lPergunta2);
p2.add(r2Certo);
p2.add(r2Errado);
p3.add(lPergunta3);
p3.add(r3Certo);
p3.add(r3Errado);
p4.add(lPergunta4);
p4.add(r4Certo);
p4.add(r4Errado);
getContentPane().add(p,BorderLayout.CENTER);
getContentPane().add(p2,BorderLayout.SOUTH);
getContentPane().add(p3,BorderLayout.CENTER);
getContentPane().add(p4,BorderLayout.SOUTH);
pack();
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String args[]){
new Teste2();
}
public void actionPerformed(ActionEvent evento) {
// TODO Auto-generated method stub
}
}
Quando executa aparece somente as duas ultimas perguntas.Queria saber saber qual é o erro.