Trying to make the checklist add up

I am designing a prototype of a learning style which has 12 question and 5 checkboxs and a user will only need to check two out the 5 checkboxs, and then it add up the results of how many A, B, C, D or E's that was checked i dont know how i'm goin to that here is a piece of code i wrote can you please help me thankx.
pls take a look at this code run it and i'll tell you what it's suppose to do.. import java.applet.Applet;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyEvent;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import javax.swing.JFileChooser;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
public class CheckPanel extends Applet{
CheckboxPanel panel1, panel2, panel3, panel4;
ItemListener iListener;
boolean state;
/*protected JFileChooser m_chooser;
//protected File m_currentFile;
//JMenuBar menuBar = createMenuBar();
//void JMenuBar(menuBar);
//m_chooser = new JFileChooser();
//try {
File dir = (new File (".")).getCanonicalFile();
m_chooser.setCurrentDirectory(dir);
} catch (IOException ex){}
updateEditor();
newDocument();
WindowListener wndCloser = new WindowAdapter(){
public void windowClosing(WindowEvent e){
if (!promptToSave())
return;
System.exit(0);
addWindowListener(wndCloser);
protected JMenuBar createMenuBar(){
final JMenuBar menuBar = new JMenuBar();
JMenu mFile = new JMenu("File");
mFile.setMnemonic('f');
JMenuItem item = new JMenuItem("New");
item.setMnemonic('n');
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK));
ActionListener lst = new ActionListener(){
public void actionPerformed(ActionEvent e){
boolean promptToSave;
if (!promptToSave);
return;
newDocument();
private void newDocument() {
// TODO Auto-generated method stub
item.addActionListener(lst);
mFile.add(item);
item = new JMenuItem("Open...");
item.setMnemonic('o');
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK));
lst = new ActionListener(){
public void actionPerformed(ActionEvent e){
boolean promptToSave;
if (!promptToSave);
return;
openDocument();
private void openDocument() {
// TODO Auto-generated method stub
item.addActionListener(lst);
mFile.add(item);
item = new JMenuItem("Save");
item.setMnemonic('s');
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK));
lst = new ActionListener(){
public void actionPerformed(ActionEvent e){
boolean m_textChanged;
if (!m_textChanged)
return ;
saveFile(false);
private void saveFile(boolean b) {
// TODO Auto-generated method stub
item.addActionListener(lst);
mFile.add(item);
item = new JMenuItem("Save As..");
item.setMnemonic('a');
lst = new ActionListener(){
public void actionperformed(ActionEvent e){
saveFile(true);
private void saveFile(boolean b) {
// TODO Auto-generated method stub
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
item.addActionListener(lst);
mFile.add(item);
mFile.addSeparator();
item = new JMenuItem("Exit");
item.setMnemonic('x');
lst = new ActionListener(){
public void actionPerformed(ActionEvent e){
System.exit(0);
item.addActionListener(lst);
mFile.add(item);
menuBar.add(mFile);
return menuBar;
//isSelected = new Checkbox();
public void init(){
setLayout(new BorderLayout());
setBounds (20, 30, 300, 180);
Panel headerPanel = new Panel();
headerPanel.setLayout(new GridLayout(2,1));
Label lblHeader = new Label("QUIZ 02 Learning Style");
headerPanel.add(lblHeader);
lblHeader = new Label("This quiz..");
Label lblHeader1 = new Label("Please tick two checkboxes for each question...");
headerPanel.add(lblHeader1);
//lblHeader1 = new Label();
headerPanel.add(lblHeader);
add(headerPanel, BorderLayout.NORTH);
//setLayout(new GridLayout(3,1));
panel1 =new CheckboxPanel();
add(panel1, BorderLayout.CENTER);
panel2 = new CheckboxPanel();
add(panel2);
panel3 =new CheckboxPanel();
add(panel3);
panel4 =new CheckboxPanel();
add(panel4);
public static final long serialVersionUID = 1L;
Checkbox check1, check2, check3, check4, check5;
void CheckboxPanel(){
setLayout(new GridLayout(4,1));
setBackground(Color.gray);
check1 = new Checkbox("1");
add(check1);
//isSelected = new Checkbox();
check1.addItemListener((ItemListener) this);
getContentPane().add(check1);// set checked state of box
check2 = new Checkbox("2");
add(check2);
check2.addItemListener((ItemListener) this);
getContentPane().add(check2);
check3 = new Checkbox("3");
add(check3);
check3.addItemListener((ItemListener) this);
getContentPane().add(check3);
check4 = new Checkbox("4");
add(check4);
check4.addItemListener((ItemListener) this);
getContentPane().add(check4);
//check5 = new Checkbox("5");
//add(check5);
public void itemStateChanged(ItemEvent e) {
int index = 0;
char a = '-';
Object source = e.getItemSelectable();
if (source == check1) {
index = 0;
a = 'a';
} else if (source == check2) {
index = 1;
a = 'b';
} else if (source == check3) {
index = 2;
a = 'c';
} else if (source == check4) {
index = 3;
a = 'd';
if (e.getStateChange() == ItemEvent.DESELECTED) {
a = '-';
//choices.setCharAt(index, a);
//System.out.println("hello");
private File newFile(String data) throws IOException {
// TODO Auto-generated method stub
File newfile = newFile("I:\\ouput.txt");
System.out.println("DATA? - " + data);
FileOutputStream fos = new FileOutputStream(newfile);
fos.write(data.getBytes());
fos.close();
JOptionPane.showMessageDialog(null, "Save File");
return null;
private Container getContentPane() {
// TODO Auto-generated method stub
return null;
import java.awt.*;
//import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentListener;
//import java.awt.event.InputEvent;
import java.awt.event.ItemListener;
//import java.awt.event.KeyEvent;
//import java.io.File;
//import java.lang.reflect.Array;
import javax.swing.JButton;
//import javax.swing.JDialog;
import javax.swing.JMenuBar;
//import javax.swing.*;
//import javax.swing.event.*;
//import javax.swing.JToggleButton;
public class CheckboxPanel extends Panel{
ItemListener iListener;
boolean state;
Button button1;
// public static Object newInstance(Class componentType,
//int length){
public static final long serialVersionUID = 1L;
//public static final char k = 0;
Checkbox[] check = new Checkbox[61];
//Checkbox check1, check2, check3, check4, check5 , check6 ,check7 ,check8 ,check9 ,check10 ,check11 ,check12 ,check13 ,
//check14 ,check15 ,check16 ,check17 ,check18 ,check19 ,check20 ,check21 ,check22 ,check23 ,check24 ,check25 ,check26 ,
//check27 ,check28 ,check29 ,check30 ,check31 ,check32 ,check33 ,check34 ,check35 ,check36 ,check37 ,check38 ,check39 ,
//check40 ,check41 ,check42 ,check43 ,check44 ,check45 ,check46 ,check47 ,check48 ,check49 ,check50 ,check51 ,check52 ,
//check53 ,check54 ,check55 ,check56 ,check57 ,check58 ,check59 ,check60,
//isSelected = new Checkbox();
protected int group1,group2,group3,group4,group5,group6,group7,group8,group9,group10,group11,group12,group13,group14,group15;
//int[] CheckBox = {k};
//Array.newInstance(private Checkbox check6;
// state of checkbox
CheckboxPanel(){
setLayout(new GridLayout(4,4));
setBackground(Color.gray);
/* Question 1 layout panel */
// Create a panel for the question and answers
Panel question1Panel = new Panel();
question1Panel.setLayout(new GridLayout(1, 2));
// Create a label for the question number
Label lbl = new Label("1");
// Add it to the question panel so it appears on the right
question1Panel.add(lbl);
// Add a panel for the answers to the question
Panel answer1Panel = new Panel();
// Use a grid layout of 4 rows by 1 column
answer1Panel.setLayout(new GridLayout(4,1));
//CheckBox.addActionListener(new ActionListener(){
//public void actionPerformed(ActionEvent ae)
// System.out.println("check box state"+check.getState());
check[1] = new Checkbox("A. Imaginative");
answer1Panel.add(check[1]);
//check1.addItemListener(iListener);
//state = check1.isSeleted() ; // tells whether box is checked
//check1.setSelected(state);
//getContentPane().add(check1);// set checked state of box
check[2] = new Checkbox("B. Investigative");
answer1Panel.add(check[2]);
//check1.addItemListener(iListener);
//state = check1.isSeleted() ; // tells whether box is checked
//check1.setSelected(state);
//getContentPane().add(check1);// set checked state of box
check[3] = new Checkbox("C. Realistic");
answer1Panel.add(check[3]);
check[4] = new Checkbox("D. Analytical");
answer1Panel.add(check[4]);
question1Panel.add(answer1Panel);
add(question1Panel);
/* Question 2 layout panel */
Panel question2Panel = new Panel();
question2Panel.setLayout(new GridLayout(1,2));
lbl = new Label("2");
question2Panel.add(lbl);
Panel answer2Panel = new Panel();
answer2Panel.setLayout(new GridLayout(4,1));
check[5] = new Checkbox("A. Organized");
answer2Panel.add(check[5]);
check[6]= new Checkbox("B. Adaptable");
answer2Panel.add(check[6]);
check[7] = new Checkbox("C. Critical");
answer2Panel.add(check[7]);
check[8] = new Checkbox("D. Inquisitive");
answer2Panel.add(check[8]);
question2Panel.add(answer2Panel);
add(question2Panel);
/* Question 3 layout panel*/
Panel question3Panel= new Panel();
question3Panel.setLayout(new GridLayout(1,2));
lbl = new Label("3");
question3Panel.add(lbl);
Panel answer3Panel = new Panel();
answer3Panel.setLayout(new GridLayout(4,1));
check[9] = new Checkbox("A. Debating");
answer3Panel.add(check[9]);
check[10] = new Checkbox("B.Getting to the point");
answer3Panel.add(check[10]);
check[11] = new Checkbox("C. Creating");
answer3Panel.add(check[11]);
check[12] = new Checkbox("D. Relating");
answer3Panel.add(check[12]);
question3Panel.add(answer3Panel);
add(question3Panel);
/* Question 4 layout panel*/
Panel question4Panel= new Panel();
question4Panel.setLayout(new GridLayout(1,2));
lbl = new Label("4");
question4Panel.add(lbl);
Panel answer4Panel = new Panel();
answer4Panel.setLayout(new GridLayout(4,1));
check[13] = new Checkbox("A. Personal");
answer4Panel.add(check[13]);
check[14] = new Checkbox("B. Practical");
answer4Panel.add(check[14]);
check[15] = new Checkbox("C. Academic");
answer4Panel.add(check[15]);
check[16] = new Checkbox("D. Adventurous");
answer4Panel.add(check[16]);
question4Panel.add(answer4Panel);
add(question4Panel);
/* Question 5 layout panel*/
Panel question5Panel= new Panel();
question5Panel.setLayout(new GridLayout(1,2));
lbl = new Label("5");
question5Panel.add(lbl);
Panel answer5Panel = new Panel();
answer5Panel.setLayout(new GridLayout(4,1));
check[17] = new Checkbox("A. Presice");
answer5Panel.add(check[17]);
check[18 ]= new Checkbox("B. Flexible");
answer5Panel.add(check[18]);
check[19] = new Checkbox("C. Systematic");
answer5Panel.add(check[19]);
check[20] = new Checkbox("D. Inventive");
answer5Panel.add(check[20]);
question5Panel.add(answer5Panel);
add(question5Panel);
/* Question 6 layout panel*/
Panel question6Panel= new Panel();
question6Panel.setLayout(new GridLayout(1,2));
lbl = new Label("6");
question6Panel.add(lbl);
Panel answer6Panel = new Panel();
answer6Panel.setLayout(new GridLayout(4,1));
check[21] = new Checkbox("A. Sharing");
answer6Panel.add(check[21]);
check[22]= new Checkbox("B. Orderly");
answer6Panel.add(check[22]);
check[23] = new Checkbox("C. Sensible");
answer6Panel.add(check[23]);
check[24] = new Checkbox("D. Independent");
answer6Panel.add(check[24]);
question6Panel.add(answer6Panel);
add(question6Panel);
/* Question 7 layout panel*/
Panel question7Panel= new Panel();
question7Panel.setLayout(new GridLayout(1,2));
lbl = new Label("7");
question7Panel.add(lbl);
Panel answer7Panel = new Panel();
answer7Panel.setLayout(new GridLayout(4,1));
check[25] = new Checkbox("A. Competitive");
answer7Panel.add(check[25]);
check[26] = new Checkbox("B. Perfectionist");
answer7Panel.add(check[26]);
check[27] = new Checkbox("C. Cooperative");
answer7Panel.add(check[27]);
check[28] = new Checkbox("D. Logical");
answer7Panel.add(check[28]);
question7Panel.add(answer7Panel);
add(question7Panel);
/* Question 8 layout panel*/
Panel question8Panel= new Panel();
question8Panel.setLayout(new GridLayout(1,2));
lbl = new Label("8");
question8Panel.add(lbl);
Panel answer8Panel = new Panel();
answer8Panel.setLayout(new GridLayout(4,1));
check[29] = new Checkbox("A. Intellectual");
answer8Panel.add(check[29]);
check[30] = new Checkbox("B. Sensitive");
answer8Panel.add(check[30]);
check[31] = new Checkbox("C. Hard-working");
answer8Panel.add(check[31]);
check[32] = new Checkbox("D. Risk-taking");
answer8Panel.add(check[32]);
question8Panel.add(answer8Panel);
add(question8Panel);
/* Question 9 layout panel*/
Panel question9Panel= new Panel();
question9Panel.setLayout(new GridLayout(1,2));
lbl = new Label("9");
question9Panel.add(lbl);
Panel answer9Panel = new Panel();
answer9Panel.setLayout(new GridLayout(4,1));
check[33] = new Checkbox("A. Reader");
answer9Panel.add(check[33]);
check[34] = new Checkbox("B. People person");
answer9Panel.add(check[34]);
check[35] = new Checkbox("C. Problem solver");
answer9Panel.add(check[35]);
check[36] = new Checkbox("D. Planner");
answer9Panel.add(check[36]);
question9Panel.add(answer9Panel);
add(question9Panel);
/* Question 10 layout panel*/
Panel question10Panel= new Panel();
question10Panel.setLayout(new GridLayout(1,2));
lbl = new Label("10");
question10Panel.add(lbl);
Panel answer10Panel = new Panel();
answer10Panel.setLayout(new GridLayout(4,1));
check[37] = new Checkbox("A. Memorize");
answer10Panel.add(check[37]);
check[38] = new Checkbox("B. Associate");
answer10Panel.add(check[38]);
check[39] = new Checkbox("C. Think-through");
answer10Panel.add(check[39]);
check[40] = new Checkbox("D. Originate");
answer10Panel.add(check[40]);
question10Panel.add(answer10Panel);
add(question10Panel);
/* Question 11 layout panel*/
Panel question11Panel= new Panel();
question11Panel.setLayout(new GridLayout(1,2));
lbl = new Label("11");
question11Panel.add(lbl);
Panel answer11Panel = new Panel();
answer11Panel.setLayout(new GridLayout(4,1));
check[41] = new Checkbox("A. Changer");
answer11Panel.add(check[41]);
check[42] = new Checkbox("B. Judger");
answer11Panel.add(check[42]);
check[43] = new Checkbox("C. Spontaneous");
answer11Panel.add(check[43]);
check[44] = new Checkbox("D. Wants direction");
answer11Panel.add(check[44]);
question11Panel.add(answer11Panel);
add(question11Panel);
/* Question 12 layout panel*/
Panel question12Panel= new Panel();
question12Panel.setLayout(new GridLayout(1,2));
lbl = new Label("12");
question12Panel.add(lbl);
Panel answer12Panel = new Panel();
answer12Panel.setLayout(new GridLayout(4,1));
check[45] = new Checkbox("A. Communicating");
answer12Panel.add(check[45]);
check[46] = new Checkbox("B. Discovering");
answer12Panel.add(check[46]);
check[47] = new Checkbox("C. Caring");
answer12Panel.add(check[47]);
check[48] = new Checkbox("D. Examining");
answer12Panel.add(check[48]);
question12Panel.add(answer12Panel);
add(question12Panel);
/* Question 13 layout panel*/
Panel question13Panel= new Panel();
question13Panel.setLayout(new GridLayout(1,2));
lbl = new Label("13");
question13Panel.add(lbl);
Panel answer13Panel = new Panel();
answer13Panel.setLayout(new GridLayout(4,1));
check[49] = new Checkbox("A. Challenging");
answer13Panel.add(check[49]);
check[50] = new Checkbox("B. Practicing");
answer13Panel.add(check[50]);
check[51] = new Checkbox("C. Caring");
answer13Panel.add(check[51]);
check[52] = new Checkbox("D. Examining");
answer13Panel.add(check[52]);
question13Panel.add(answer13Panel);
add(question13Panel);
/* Question 14 layout panel*/
Panel question14Panel= new Panel();
question13Panel.setLayout(new GridLayout(1,2));
lbl = new Label("14 ");
question14Panel.add(lbl);
Panel answer14Panel = new Panel();
answer14Panel.setLayout(new GridLayout(4,1));
check[53] = new Checkbox("A. Completing work");
answer14Panel.add(check[53]);
check[54] = new Checkbox("B. Seeing possibilities");
answer14Panel.add(check[54]);
check[55] = new Checkbox("C. Gaining ideas");
answer14Panel.add(check[55]);
check[56] = new Checkbox("D. Interpreting");
answer14Panel.add(check[56]);
question14Panel.add(answer14Panel);
add(question14Panel);
/* Question 15 layout panel*/
Panel question15Panel= new Panel();
question15Panel.setLayout(new GridLayout(1,2));
lbl = new Label("15");
question15Panel.add(lbl);
Panel answer15Panel = new Panel();
answer15Panel.setLayout(new GridLayout(4,1));
check[57] = new Checkbox("A. Doing");
answer15Panel.add(check[57]);
check[58] = new Checkbox("B. Feeling");
answer15Panel.add(check[58]);
check[59] = new Checkbox("C. Thinking");
answer15Panel.add(check[59]);
check[60] = new Checkbox("D. Experimenting");
answer15Panel.add(check[60]);
question15Panel.add(answer15Panel);
add(question15Panel);
/*class ToggleButton extends JFrame{
public ToggleButton(){
super("ToggleButton");
getContentPane().setLayout(new FlowLayout());
ButtonGroup buttonGroup =new ButtonGroup();
char ch = (char) ('1'+ k);
for (int k=0; k<4; k++){
JToggleButton button = new JToggleButton("Button"+ch, k==0);
button.setMnemonic(ch);
button.setEnabled(k<3);
button.setToolTipText("This is button"+ ch);
getContentPane().add(button);
buttonGroup.add(button);
//pack();
JButton button1 = new JButton("SUBMIT");
//Object BOX_TITLE;
//JDialog dialog = Panel.createDialog(Dialog.this, BOX_TITLE);
//dialog.show();
add(button1);
addComponentListener((ComponentListener) iListener);
ActionListener al = new ActionListener(){
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
if (check[1].getState()== true){
group1 = group1 +1;
if (check[2].getState()== true){
group1 = group1 +1;
if (check[3].getState()== true){
group1 = group1 +1;
if (check[4].getState()== true){
group1 = group1 +1;
if (check[5].getState()== true){
group2 = group2 +1;
if (check[6].getState()== true){
group2 = group2 +1;
if (check[7].getState()== true){
group2 = group2 +1;
if (check[8].getState()== true){
group2 = group2 +1;
if (check[9].getState()== true){
group3 = group3 +1;
if (check[10].getState()== true){
group3 = group3 +1;
if (check[11].getState()== true){
group3 = group3 +1;
if (check[12].getState()== true){
group3 = group3 +1;
if (check[13].getState()== true){
group4 = group4 +1;
if (check[14].getState()== true){
group4 = group4 +1;
if (check[15].getState()== true){
group4 = group4 +1;
if (check[16].getState()== true){
group4 = group4 +1;
if (check[17].getState()== true){
group5 = group5 +1;
if (check[18].getState()== true){
group5 = group5 +1;
if (check[19].getState()== true){
group5 = group5 +1;
if (check[20].getState()== true){
group5 = group5 +1;
if (check[21].getState()== true){
group6 = group6 +1;
if (check[22].getState()== true){
group6 = group6 +1;
if (check[23].getState()== true){
group6 = group6 +1;
if (check[24].getState()== true){
group6 = group6 +1;
if (check[25].getState()== true){
group7 = group7 +1;
if (check[26].getState()== true){
group7 = group7 +1;
if (check[27].getState()== true){
group7 = group7 +1;
if (check[28].getState()== true){
group7 = group7 +1;
if (check[29].getState()== true){
group8 = group8 +1;
if (check[30].getState()== true){
group8 = group8 +1;
if (check[31].getState()== true){
group8 = group8 +1;
if (check[32].getState()== true){
group8 = group8 +1;
if (check[33].getState()== true){
group9 = group9 +1;
if (check[34].getState()== true){
group9 = group9 +1;
if (check[35].getState()== true){
group9 = group9 +1;
if (check[36].getState()== true){
group9 = group9 +1;
if (check[37].getState()== true){
group10 = group10 +1;
if (check[38].getState()== true){
group10 = group10 +1;
if (check[39].getState()== true){
group10 = group10 +1;
if (check[40].getState()== true){
group10 = group10 +1;
if (check[41].getState()== true){
group11 = group11 +1;
if (check[42].getState()== true){
group11 = group11 +1;
if (check[43].getState()== true){
group11 = group11 +1;
if (check[44].getState()== true){
group11 = group11 +1;
if (check[45].getState()== true){
group12 = group12 +1;
if (check[46].getState()== true){
group12 = group12 +1;
if (check[47].getState()== true){
group12 = group12 +1;
if (check[48].getState()== true){
group12 = group12 +1;
if (check[49].getState()== true){
group13 = group13 +1;
if (check[50].getState()== true){
group13 = group13 +1;
if (check[51].getState()== true){
group13 = group13 +1;
if (check[52].getState()== true){
group13 = group13 +1;
if (check[53].getState()== true){
group14 = group14 +1;
if (check[54].getState()== true){
group14 = group14 +1;
if (check[55].getState()== true){
group14 = group14 +1;
if (check[56].getState()== true){
group14 = group14 +1;
if (check[57].getState()== true){
group15 = group15 +1;
if (check[58].getState()== true){
group15 = group15 +1;
if (check[59].getState()== true){
group15 = group15 +1;
if (check[60].getState()== true){
group15 = group15 +1;
System.out.println(check[1].getState());
System.out.println(check[2].getState());
System.out.println(check[3].getState());
System.out.println(check[4].getState());
System.out.println(check[5].getState());
System.out.println(check[6].getState());
System.out.println(check[7].getState());
System.out.println(check[8].getState());
System.out.println(check[9].getState());
System.out.println(check[10].getState());
System.out.println(check[11].getState());
System.out.println(check[12].getState());
System.out.println(check[13].getState());
System.out.println(check[14].getState());
System.out.println(check[15].getState());
System.out.println(check[16].getState());
System.out.println(check[17].getState());
System.out.println(check[18].getState());
System.out.println(check[19].getState());
System.out.println(check[20].getState());
System.out.println(check[21].getState());
System.out.println(check[22].getState());
System.out.println(check[23].getState());
System.out.println(check[24].getState());
System.out.println(check[25].getState());
System.out.println(check[26].getState());
System.out.println(check[27].getState());
System.out.println(check[28].getState());
System.out.println(check[29].getState());
System.out.println(check[30].getState());
System.out.println(check[31].getState());
System.out.println(check[32].getState());
System.out.println(check[33].getState());
System.out.println(check[34].getState());
System.out.println(check[35].getState());
System.out.println(check[36].getState());
System.out.println(check[37].getState());
System.out.println(check[38].getState());
System.out.println(check[39].getState());
System.out.println(check[40].getState());
System.out.println(check[41].getState());
System.out.println(check[42].getState());
System.out.println(check[43].getState());
System.out.println(check[44].getState());
System.out.println(check[45].getState());
System.out.println(check[46].getState());
System.out.println(check[47].getState());
System.out.println(check[48].getState());
System.out.println(check[49].getState());
System.out.println(check[50].getState());
System.out.println(check[51].getState());
System.out.println(check[52].getState());
System.out.println(check[53].getState());
System.out.println(check[54].getState());
System.out.println(check[55].getState());
System.out.println(check[56].getState());
System.out.println(check[57].getState());
System.out.println(check[58].getState());
System.out.println(check[59].getState());
System.out.println(check[60].getState());
button1.addActionListener(al);
private JMenuBar createMenuBar() {
// TODO Auto-generated method stub
return null;
//button1.addActionListener(al);
}

am designing a prototype of a learning style which has 12 question and 5 checkboxs and a user will only need to check two out the 5 checkboxs, and then it add up the results of how many A, B, C, D or E's that was checked i dont know how i'm goin to that here is a piece of code i wrote can you please help me thankx. pls take a look at this code run it and i'll tell you what it's suppose to do..
import java.applet.Applet;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyEvent;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import javax.swing.JFileChooser;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
public class CheckPanel extends Applet{
CheckboxPanel panel1, panel2, panel3, panel4;
ItemListener iListener;
boolean state;
/*protected JFileChooser m_chooser;
//protected File m_currentFile;
//JMenuBar menuBar = createMenuBar();
//void JMenuBar(menuBar);
//m_chooser = new JFileChooser();
//try {
File dir = (new File (".")).getCanonicalFile();
m_chooser.setCurrentDirectory(dir);
} catch (IOException ex){}
updateEditor();
newDocument();
WindowListener wndCloser = new WindowAdapter(){
public void windowClosing(WindowEvent e){
if (!promptToSave())
return;
System.exit(0);
addWindowListener(wndCloser);
protected JMenuBar createMenuBar(){
final JMenuBar menuBar = new JMenuBar();
JMenu mFile = new JMenu("File");
mFile.setMnemonic('f');
JMenuItem item = new JMenuItem("New");
item.setMnemonic('n');
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK));
ActionListener lst = new ActionListener(){
public void actionPerformed(ActionEvent e){
boolean promptToSave;
if (!promptToSave);
return;
newDocument();
private void newDocument() {
// TODO Auto-generated method stub
item.addActionListener(lst);
mFile.add(item);
item = new JMenuItem("Open...");
item.setMnemonic('o');
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK));
lst = new ActionListener(){
public void actionPerformed(ActionEvent e){
boolean promptToSave;
if (!promptToSave);
return;
openDocument();
private void openDocument() {
// TODO Auto-generated method stub
item.addActionListener(lst);
mFile.add(item);
item = new JMenuItem("Save");
item.setMnemonic('s');
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK));
lst = new ActionListener(){
public void actionPerformed(ActionEvent e){
boolean m_textChanged;
if (!m_textChanged)
return ;
saveFile(false);
private void saveFile(boolean b) {
// TODO Auto-generated method stub
item.addActionListener(lst);
mFile.add(item);
item = new JMenuItem("Save As..");
item.setMnemonic('a');
lst = new ActionListener(){
public void actionperformed(ActionEvent e){
saveFile(true);
private void saveFile(boolean b) {
// TODO Auto-generated method stub
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
item.addActionListener(lst);
mFile.add(item);
mFile.addSeparator();
item = new JMenuItem("Exit");
item.setMnemonic('x');
lst = new ActionListener(){
public void actionPerformed(ActionEvent e){
System.exit(0);
item.addActionListener(lst);
mFile.add(item);
menuBar.add(mFile);
return menuBar;
//isSelected = new Checkbox();
public void init(){
setLayout(new BorderLayout());
setBounds (20, 30, 300, 180);
Panel headerPanel = new Panel();
headerPanel.setLayout(new GridLayout(2,1));
Label lblHeader = new Label("QUIZ 02 Learning Style");
headerPanel.add(lblHeader);
lblHeader = new Label("This quiz..");
Label lblHeader1 = new Label("Please tick two checkboxes for each question...");
headerPanel.add(lblHeader1);
//lblHeader1 = new Label();
headerPanel.add(lblHeader);
add(headerPanel, BorderLayout.NORTH);
//setLayout(new GridLayout(3,1));
panel1 =new CheckboxPanel();
add(panel1, BorderLayout.CENTER);
panel2 = new CheckboxPanel();
add(panel2);
panel3 =new CheckboxPanel();
add(panel3);
panel4 =new CheckboxPanel();
add(panel4);
public static final long serialVersionUID = 1L;
Checkbox check1, check2, check3, check4, check5;
void CheckboxPanel(){
setLayout(new GridLayout(4,1));
setBackground(Color.gray);
check1 = new Checkbox("1");
add(check1);
//isSelected = new Checkbox();
check1.addItemListener((ItemListener) this);
getContentPane().add(check1);// set checked state of box
check2 = new Checkbox("2");
add(check2);
check2.addItemListener((ItemListener) this);
getContentPane().add(check2);
check3 = new Checkbox("3");
add(check3);
check3.addItemListener((ItemListener) this);
getContentPane().add(check3);
check4 = new Checkbox("4");
add(check4);
check4.addItemListener((ItemListener) this);
getContentPane().add(check4);
//check5 = new Checkbox("5");
//add(check5);
public void itemStateChanged(ItemEvent e) {
int index = 0;
char a = '-';
Object source = e.getItemSelectable();
if (source == check1) {
index = 0;
a = 'a';
} else if (source == check2) {
index = 1;
a = 'b';
} else if (source == check3) {
index = 2;
a = 'c';
} else if (source == check4) {
index = 3;
a = 'd';
if (e.getStateChange() == ItemEvent.DESELECTED) {
a = '-';
//choices.setCharAt(index, a);
//System.out.println("hello");
private File newFile(String data) throws IOException {
// TODO Auto-generated method stub
File newfile = newFile("I:\\ouput.txt");
System.out.println("DATA? - " + data);
FileOutputStream fos = new FileOutputStream(newfile);
fos.write(data.getBytes());
fos.close();
JOptionPane.showMessageDialog(null, "Save File");
return null;
private Container getContentPane() {
// TODO Auto-generated method stub
return null;
import java.awt.*;
//import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentListener;
//import java.awt.event.InputEvent;
import java.awt.event.ItemListener;
//import java.awt.event.KeyEvent;
//import java.io.File;
//import java.lang.reflect.Array;
import javax.swing.JButton;
//import javax.swing.JDialog;
import javax.swing.JMenuBar;
//import javax.swing.*;
//import javax.swing.event.*;
//import javax.swing.JToggleButton;
public class CheckboxPanel extends Panel{
ItemListener iListener;
boolean state;
Button button1;
// public static Object newInstance(Class componentType,
//int length){
public static final long serialVersionUID = 1L;
//public static final char k = 0;
Checkbox[] check = new Checkbox[61];
//Checkbox check1, check2, check3, check4, check5 , check6 ,check7 ,check8 ,check9 ,check10 ,check11 ,check12 ,check13 ,
//check14 ,check15 ,check16 ,check17 ,check18 ,check19 ,check20 ,check21 ,check22 ,check23 ,check24 ,check25 ,check26 ,
//check27 ,check28 ,check29 ,check30 ,check31 ,check32 ,check33 ,check34 ,check35 ,check36 ,check37 ,check38 ,check39 ,
//check40 ,check41 ,check42 ,check43 ,check44 ,check45 ,check46 ,check47 ,check48 ,check49 ,check50 ,check51 ,check52 ,
//check53 ,check54 ,check55 ,check56 ,check57 ,check58 ,check59 ,check60,
//isSelected = new Checkbox();
protected int group1,group2,group3,group4,group5,group6,group7,group8,group9,group10,group11,group12,group13,group14,group15;
//int[] CheckBox = {k};
//Array.newInstance(private Checkbox check6;
// state of checkbox
CheckboxPanel(){
setLayout(new GridLayout(4,4));
setBackground(Color.gray);
/* Question 1 layout panel */
// Create a panel for the question and answers
Panel question1Panel = new Panel();
question1Panel.setLayout(new GridLayout(1, 2));
// Create a label for the question number
Label lbl = new Label("1");
// Add it to the question panel so it appears on the right
question1Panel.add(lbl);
// Add a panel for the answers to the question
Panel answer1Panel = new Panel();
// Use a grid layout of 4 rows by 1 column
answer1Panel.setLayout(new GridLayout(4,1));
//CheckBox.addActionListener(new ActionListener(){
//public void actionPerformed(ActionEvent ae)
// System.out.println("check box state"+check.getState());
check[1] = new Checkbox("A. Imaginative");
answer1Panel.add(check[1]);
//check1.addItemListener(iListener);
//state = check1.isSeleted() ; // tells whether box is checked
//check1.setSelected(state);
//getContentPane().add(check1);// set checked state of box
check[2] = new Checkbox("B. Investigative");
answer1Panel.add(check[2]);
//check1.addItemListener(iListener);
//state = check1.isSeleted() ; // tells whether box is checked
//check1.setSelected(state);
//getContentPane().add(check1);// set checked state of box
check[3] = new Checkbox("C. Realistic");
answer1Panel.add(check[3]);
check[4] = new Checkbox("D. Analytical");
answer1Panel.add(check[4]);
question1Panel.add(answer1Panel);
add(question1Panel);
/* Question 2 layout panel */
Panel question2Panel = new Panel();
question2Panel.setLayout(new GridLayout(1,2));
lbl = new Label("2");
question2Panel.add(lbl);
Panel answer2Panel = new Panel();
answer2Panel.setLayout(new GridLayout(4,1));
check[5] = new Checkbox("A. Organized");
answer2Panel.add(check[5]);
check[6]= new Checkbox("B. Adaptable");
answer2Panel.add(check[6]);
check[7] = new Checkbox("C. Critical");
answer2Panel.add(check[7]);
check[8] = new Checkbox("D. Inquisitive");
answer2Panel.add(check[8]);
question2Panel.add(answer2Panel);
add(question2Panel);
/* Question 3 layout panel*/
Panel question3Panel= new Panel();
question3Panel.setLayout(new GridLayout(1,2));
lbl = new Label("3");
question3Panel.add(lbl);
Panel answer3Panel = new Panel();
answer3Panel.setLayout(new GridLayout(4,1));
check[9] = new Checkbox("A. Debating");
answer3Panel.add(check[9]);
check[10] = new Checkbox("B.Getting to the point");
answer3Panel.add(check[10]);
check[11] = new Checkbox("C. Creating");
answer3Panel.add(check[11]);
check[12] = new Checkbox("D. Relating");
answer3Panel.add(check[12]);
question3Panel.add(answer3Panel);
add(question3Panel);
/* Question 4 layout panel*/
Panel question4Panel= new Panel();
question4Panel.setLayout(new GridLayout(1,2));
lbl = new Label("4");
question4Panel.add(lbl);
Panel answer4Panel = new Panel();
answer4Panel.setLayout(new GridLayout(4,1));
check[13] = new Checkbox("A. Personal");
answer4Panel.add(check[13]);
check[14] = new Checkbox("B. Practical");
answer4Panel.add(check[14]);
check[15] = new Checkbox("C. Academic");
answer4Panel.add(check[15]);
check[16] = new Checkbox("D. Adventurous");
answer4Panel.add(check[16]);
question4Panel.add(answer4Panel);
add(question4Panel);
/* Question 5 layout panel*/
Panel question5Panel= new Panel();
question5Panel.setLayout(new GridLayout(1,2));
lbl = new Label("5");
question5Panel.add(lbl);
Panel answer5Panel = new Panel();
answer5Panel.setLayout(new GridLayout(4,1));
check[17] = new Checkbox("A. Presice");
answer5Panel.add(check[17]);
check[18 ]= new Checkbox("B. Flexible");
answer5Panel.add(check[18]);
check[19] = new Checkbox("C. Systematic");
answer5Panel.add(check[19]);
check[20] = new Checkbox("D. Inventive");
answer5Panel.add(check[20]);
question5Panel.add(answer5Panel);
add(question5Panel);
/* Question 6 layout panel*/
Panel question6Panel= new Panel();
question6Panel.setLayout(new GridLayout(1,2));
lbl = new Label("6");
question6Panel.add(lbl);
Panel answer6Panel = new Panel();
answer6Panel.setLayout(new GridLayout(4,1));
check[21] = new Checkbox("A. Sharing");
answer6Panel.add(check[21]);
check[22]= new Checkbox("B. Orderly");
answer6Panel.add(check[22]);
check[23] = new Checkbox("C. Sensible");
answer6Panel.add(check[23]);
check[24] = new Checkbox("D. Independent");
answer6Panel.add(check[24]);
question6Panel.add(answer6Panel);
add(question6Panel);
/* Question 7 layout panel*/
Panel question7Panel= new Panel();
question7Panel.setLayout(new GridLayout(1,2));
lbl = new Label("7");
question7Panel.add(lbl);
Panel answer7Panel = new Panel();
answer7Panel.setLayout(new GridLayout(4,1));
check[25] = new Checkbox("A. Competitive");
answer7Panel.add(check[25]);
check[26] = new Checkbox("B. Perfectionist");
answer7Panel.add(check[26]);
check[27] = new Checkbox("C. Cooperative");
answer7Panel.add(check[27]);
check[28] = new Checkbox("D. Logical");
answer7Panel.add(check[28]);
question7Panel.add(answer7Panel);
add(question7Panel);
/* Question 8 layout panel*/
Panel question8Panel= new Panel();
question8Panel.setLayout(new GridLayout(1,2));
lbl = new Label("8");
question8Panel.add(lbl);
Panel answer8Panel = new Panel();
answer8Panel.setLayout(new GridLayout(4,1));
check[29] = new Checkbox("A. Intellectual");
answer8Panel.add(check[29]);
check[30] = new Checkbox("B. Sensitive");
answer8Panel.add(check[30]);
check[31] = new Checkbox("C. Hard-working");
answer8Panel.add(check[31]);
check[32] = new Checkbox("D. Risk-taking");
answer8Panel.add(check[32]);
question8Panel.add(answer8Panel);
add(question8Panel);
/* Question 9 layout panel*/
Panel question9Panel= new Panel();
question9Panel.setLayout(new GridLayout(1,2));
lbl = new Label("9");
question9Panel.add(lbl);
Panel answer9Panel = new Panel();
answer9Panel.setLayout(new GridLayout(4,1));
check[33] = new Checkbox("A. Reader");
answer9Panel.add(check[33]);
check[34] = new Checkbox("B. People person");
answer9Panel.add(check[34]);
check[35] = new Checkbox("C. Problem solver");
answer9Panel.add(check[35]);
check[36] = new Checkbox("D. Planner");
answer9Panel.add(check[36]);
question9Panel.add(answer9Panel);
add(question9Panel);
/* Question 10 layout panel*/
Panel question10Panel= new Panel();
question10Panel.setLayout(new GridLayout(1,2));
lbl = new Label("10");
question10Panel.add(lbl);
Panel answer10Panel = new Panel();
answer10Panel.setLayout(new GridLayout(4,1));
check[37] = new Checkbox("A. Memorize");
answer10Panel.add(check[37]);
check[38] = new Checkbox("B. Associate");
answer10Panel.add(check[38]);
check[39] = new Checkbox("C. Think-through");
answer10Panel.add(check[39]);
check[40] = new Checkbox("D. Originate");
answer10Panel.add(check[40]);
question10Panel.add(answer10Panel);
add(question10Panel);
/* Question 11 layout panel*/
Panel question11Panel= new Panel();
question11Panel.setLayout(new GridLayout(1,2));
lbl = new Label("11");
question11Panel.add(lbl);
Panel answer11Panel = new Panel();
answer11Panel.setLayout(new GridLayout(4,1));
check[41] = new Checkbox("A. Changer");
answer11Panel.add(check[41]);
check[42] = new Checkbox("B. Judger");
answer11Panel.add(check[42]);
check[43] = new Checkbox("C. Spontaneous");
answer11Panel.add(check[43]);
check[44] = new Checkbox("D. Wants direction");
answer11Panel.add(check[44]);
question11Panel.add(answer11Panel);
add(question11Panel);
/* Question 12 layout panel*/
Panel question12Panel= new Panel();
question12Panel.setLayout(new GridLayout(1,2));
lbl = new Label("12");
question12Panel.add(lbl);
Panel answer12Panel = new Panel();
answer12Panel.setLayout(new GridLayout(4,1));
check[45] = new Checkbox("A. Communicating");
answer12Panel.add(check[45]);
check[46] = new Checkbox("B. Discovering");
answer12Panel.add(check[46]);
check[47] = new Checkbox("C. Caring");
answer12Panel.add(check[47]);
check[48] = new Checkbox("D. Examining");
answer12Panel.add(check[48]);
question12Panel.add(answer12Panel);
add(question12Panel);
/* Question 13 layout panel*/
Panel question13Panel= new Panel();
question13Panel.setLayout(new GridLayout(1,2));
lbl = new Label("13");
question13Panel.add(lbl);
Panel answer13Panel = new Panel();
answer13Panel.setLayout(new GridLayout(4,1));
check[49] = new Checkbox("A. Challenging");
answer13Panel.add(check[49]);
check[50] = new Checkbox("B. Practicing");
answer13Panel.add(check[50]);
check[51] = new Checkbox("C. Caring");
answer13Panel.add(check[51]);
check[52] = new Checkbox("D. Examining");
answer13Panel.add(check[52]);
question13Panel.add(answer13Panel);
add(question13Panel);
/* Question 14 layout panel*/
Panel question14Panel= new Panel();
question13Panel.setLayout(new GridLayout(1,2));
lbl = new Label("14 ");
question14Panel.add(lbl);
Panel answer14Panel = new Panel();
answer14Panel.setLayout(new GridLayout(4,1));
check[53] = new Checkbox("A. Completing work");
answer14Panel.add(check[53]);
check[54] = new Checkbox("B. Seeing possibilities");
answer14Panel.add(check[54]);
check[55] = new Checkbox("C. Gaining ideas");
answer14Panel.add(check[55]);
check[56] = new Checkbox("D. Interpreting");
answer14Panel.add(check[56]);
question14Panel.add(answer14Panel);
add(question14Panel);
/* Question 15 layout panel*/
Panel question15Panel= new Panel();
question15Panel.setLayout(new GridLayout(1,2));
lbl = new Label("15");
question15Panel.add(lbl);
Panel answer15Panel = new Panel();
answer15Panel.setLayout(new GridLayout(4,1));
check[57] = new Checkbox("A. Doing");
answer15Panel.add(check[57]);
check[58] = new Checkbox("B. Feeling");
answer15Panel.add(check[58]);
check[59] = new Checkbox("C. Thinking");
answer15Panel.add(check[59]);
check[60] = new Checkbox("D. Experimenting");
answer15Panel.add(check[60]);
question15Panel.add(answer15Panel);
add(question15Panel);
/*class ToggleButton extends JFrame{
public ToggleButton(){
super("ToggleButton");
getContentPane().setLayout(new FlowLayout());
ButtonGroup buttonGroup =new ButtonGroup();
char ch = (char) ('1'+ k);
for (int k=0; k<4; k++){
JToggleButton button = new JToggleButton("Button"+ch, k==0);
button.setMnemonic(ch);
button.setEnabled(k<3);
button.setToolTipText("This is button"+ ch);
getContentPane().add(button);
buttonGroup.add(button);
//pack();
JButton button1 = new JButton("SUBMIT");
//Object BOX_TITLE;
//JDialog dialog = Panel.createDialog(Dialog.this, BOX_TITLE);
//dialog.show();
add(button1);
addComponentListener((ComponentListener) iListener);
ActionListener al = new ActionListener(){
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
if (check[1].getState()== true){
group1 = group1 +1;
if (check[2].getState()== true){
group1 = group1 +1;
if (check[3].getState()== true){
group1 = group1 +1;
if (check[4].getState()== true){
group1 = group1 +1;
if (check[5].getState()== true){
group2 = group2 +1;
if (check[6].getState()== true){
group2 = group2 +1;
if (check[7].getState()== true){
group2 = group2 +1;
if (check[8].getState()== true){
group2 = group2 +1;
if (check[9].getState()== true){
group3 = group3 +1;
if (check[10].getState()== true){
group3 = group3 +1;
if (check[11].getState()== true){
group3 = group3 +1;
if (check[12].getState()== true){
group3 = group3 +1;
if (check[13].getState()== true){
group4 = group4 +1;
if (check[14].getState()== true){
group4 = group4 +1;
if (check[15].getState()== true){
group4 = group4 +1;
if (check[16].getState()== true){
group4 = group4 +1;
if (check[17].getState()== true){
group5 = group5 +1;
if (check[18].getState()== true){
group5 = group5 +1;
if (check[19].getState()== true){
group5 = group5 +1;
if (check[20].getState()== true){
group5 = group5 +1;
if (check[21].getState()== true){
group6 = group6 +1;
if (check[22].getState()== true){
group6 = group6 +1;
if (check[23].getState()== true){
group6 = group6 +1;
if (check[24].getState()== true){
group6 = group6 +1;
if (check[25].getState()== true){
group7 = group7 +1;
if (check[26].getState()== true){
group7 = group7 +1;
if (check[27].getState()== true){
group7 = group7 +1;
if (check[28].getState()== true){
group7 = group7 +1;
if (check[29].getState()== true){
group8 = group8 +1;
if (check[30].getState()== true){
group8 = group8 +1;
if (check[31].getState()== true){
group8 = group8 +1;
if (check[32].getState()== true){
group8 = group8 +1;
if (check[33].getState()== true){
group9 = group9 +1;
if (check[34].getState()== true){
group9 = group9 +1;
if (check[35].getState()== true){
group9 = group9 +1;
if (check[36].getState()== true){
group9 = group9 +1;
if (check[37].getState()== true){
group10 = group10 +1;
if (check[38].getState()== true){
group10 = group10 +1;
if (check[39].getState()== true){
group10 = group10 +1;
if (check[40].getState()== true){
group10 = group10 +1;
if (check[41].getState()== true){
group11 = group11 +1;
if (check[42].getState()== true){
group11 = group11 +1;
if (check[43].getState()== true){
group11 = group11 +1;
if (check[44].getState()== true){
group11 = group11 +1;
if (check[45].getState()== true){
group12 = group12 +1;
if (check[46].getState()== true){
group12 = group12 +1;
if (check[47].getState()== true){
group12 = group12 +1;
if (check[48].getState()== true){
group12 = group12 +1;
if (check[49].getState()== true){
group13 = group13 +1;
if (check[50].getState()== true){
group13 = group13 +1;
if (check[51].getState()== true){
group13 = group13 +1;
if (check[52].getState()== true){
group13 = group13 +1;
if (check[53].getState()== true){
group14 = group14 +1;
if (check[54].getState()== true){
group14 = group14 +1;
if (check[55].getState()== true){
group14 = group14 +1;
if (check[56].getState()== true){
group14 = group14 +1;
if (check[57].getState()== true){
group15 = group15 +1;
if (check[58].getState()== true){
group15 = group15 +1;
if (check[59].getState()== true){
group15 = group15 +1;
if (check[60].getState()== true){
group15 = group15 +1;
System.out.println(check[1].getState());
System.out.println(check[2].getState());
System.out.println(check[3].getState());
System.out.println(check[4].getState());
System.out.println(check[5].getState());
System.out.println(check[6].getState());
System.out.println(check[7].getState());
System.out.println(check[8].getState());
System.out.println(check[9].getState());
System.out.println(check[10].getState());
System.out.println(check[11].getState());
System.out.println(check[12].getState());
System.out.println(check[13].getState());
System.out.println(check[14].getState());
System.out.println(check[15].getState());
System.out.println(check[16].getState());
System.out.println(check[17].getState());
System.out.println(check[18].getState());
System.out.println(check[19].getState());
System.out.println(check[20].getState());
System.out.println(check[21].getState());
System.out.println(check[22].getState());
System.out.println(check[23].getState());
System.out.println(check[24].getState());
System.out.println(check[25].getState());
System.out.println(check[26].getState());
System.out.println(check[27].getState());
System.out.println(check[28].getState());
System.out.println(check[29].getState());
System.out.println(check[30].getState());
System.out.println(check[31].getState());
System.out.println(check[32].getState());
System.out.println(check[33].getState());
System.out.println(check[34].getState());
System.out.println(check[35].getState());
System.out.println(check[36].getState());
System.out.println(check[37].getState());
System.out.println(check[38].getState());
System.out.println(check[39].getState());
System.out.println(check[40].getState());
System.out.println(check[41].getState());
System.out.println(check[42].getState());
System.out.println(check[43].getState());
System.out.println(check[44].getState());
System.out.println(check[45].getState());
System.out.println(check[46].getState());
System.out.println(check[47].getState());
System.out.println(check[48].getState());
System.out.println(check[49].getState());
System.out.println(check[50].getState());
System.out.println(check[51].getState());
System.out.println(check[52].getState());
System.out.println(check[53].getState());
System.out.println(check[54].getState());
System.out.println(check[55].getState());
System.out.println(check[56].getState());
System.out.println(check[57].getState());
System.out.println(check[58].getState());
System.out.println(check[59].getState());
System.out.println(check[60].getState());
button1.addActionListener(al);
private JMenuBar createMenuBar() {
// TODO Auto-generated method stub
return null;
//button1.addActionListener(al);
}

Similar Messages

  • Hello I am just wondering why there is a message of error 1004 when i tryed to make the update on my apps. Does someone know what it means?

    Hello I am just wondering why there is a message of error 1004 when i tryed to make the update on my apps. Does someone know what it means?

    Yes, many know what this means.  You can too.  Just type in "error 1004" in the search box at the top of this page.  Or, just look to the right.  You'll find many links in the "More Like This" box. 
    Always good forum etiquette to search for previous posts on the topic before posting.

  • I am trying to get the CLIPPINGS add on for firefox. but it says it is not compatible with FirFox 8.0 whaat can I do.

    I am trying to get the CLIPPINGS add on for firefox. but when I try and download it, it says it is not compatible with FirFox 8.0. also the latest version of firfox is 3.1 but my version is 8.0 Is that right?

    There were some issues with the addons site and checking for (compatibility) updates.<br />
    It seems to be working now, so you can try again to install the extension.

  • I tried to download the Firefox Add on Web Developer and I got an error message and I don't know how to proceed.

    Hi
    I have Firefox 3.0.1 and then it also says Mozilla 5.0. So first I don't even know if this is the right product but I didn't know what else to do.
    I'm trying to I tried to download the Firefox Add on Web Developer and I got an error message of: Firefox could not install the file at http://releases.mozilla.org/pub/mozilla.org/addons/60/web_developer-1.1.9-fx+sm.xpi because: Unexpected installation error Review the Error Console log for more details. -203
    I've tried it like 3-4 times. I don't know what I'm doing wrong.
    Any suggestions???
    THANK YOU :-)
    Erin

    You should update to the latest Firefox 3.6.x version:
    *http://www.mozilla.com/firefox/all.html
    *http://www.mozilla.com/firefox/all-older.html
    See:
    *http://kb.mozillazine.org/Unable_to_install_themes_or_extensions_-_Firefox

  • Trying to make the jump from JPEG to RAW...

    Hi all, I'm trying to make the jump from JPEG to RAW, and am hoping you might be able to help with a few questions.
    When I open JPEGs in Lightroom's Develop module, the settings are mostly zero by default. But when I open RAW files, some of the settings seem to have non-zero default to values.
    Am I correct to think these settings are from metadata saved into the RAW file when I took the picture? eg, the camera saves the White Balance settings as metadata within the RAW file, even though the White Balance settings don't actually affect the image data itself. And so when I open that RAW file in Lightroom, it'll apply the White Balance as recorded within the file, making that a non-zero default.
    Is that about right?
    Does Lightroom similarly 'pre-set' other values when importing RAW files? (I ask because I seem to have non-zero settings for Blacks, Sharpening, as well as the Color slider under Noise Reduction.)
    Meaning: I'm not quite sure "how much work" Lightroom is doing by default when I import RAW files, and how much I need to do to at least reproduce what my camera would do in making a JPEG.
    For example, even though Color under Noise Reduction is given a value -- Luminance, also under under Noise Reduction, is left at zero. And the picture looks a bit grainy. Would my camera have processed some Luminance Noise Reduction? If so, is there a way to get Lightroom to help get that pre-set too?
    Basically, is there a rule of thumb for how a novice should import a RAW file and have it reasonably "at least as good" as what the JPEG would have been?
    Thanks very kindly, -Scott

    Given that the camera ships with so many special effect presets -- is there no built-in preset that could be named "Auto Camera" so to speak? Or might it be possible import such a preset that somebody else has made?
    Lightroom, nor any other third party raw processing program will not read the camera settings beyond simple stuff such as white balance. So you cannot do this. If you go raw, you really have to change your mindset and completely ignore the in-camera jpeg styles. Just set it to a neutral style and learn what the preview on the camera means for the actual raw data. You will find that this gives you orders of magnitude more creative freedom afterwards as you will not be stuck with a burned in interpretation.
    So (for me) even just making my own presets -- let alone making separate presets for every ISO -- all that seems a bit daunting.
    There really is no need to at all. I don't use presets for example. I think they are a waste of time as it is extremely rare that two images need exactly the same treatment. You really are just choosing a different starting point. I start all my raw at a relatively neutral setting (but using a camera profile generated from a colorchecker!) and blast through a shoot very quickly. You'll learn how to recognize what modifications to the Develop settings images need and just do it. Then typically I use auto-sync or manual sync to modify similar shots (say a series of head shots taken shortly after each other). I work differently as most of my photography is landscape, but a typical workflow for many photographers that do more people/style/event stuff is to import all the raw and start culling them with pick/reject flags and refine collection. You'll arrive at a subset that is worth looking  at more closely and to finetune their development. The conservative default rendering helps you here because you'll quickly see what images are simply badly exposed, not in correct focus, etc. and you can reject them.
    Think of your raw as the unprinted negative. It represents a nascent image. One that still has to form completely. A jpeg is like a polaroid. The image style is pretty much chosen for you by the film maker. There is very little you can do to it afterwards without it breaking down. Raw gives you much more freedom but it does come with a learning curve and it is more tasking for your equipment. Many people including many pros are simply not interested (or don't see the pay off) in this part of the creative photographic process and just shoot jpeg, which is a fine approach (just not mine). Lightroom can help you there too to quickly find the best images in a series, keyword, caption, and disseminate.

  • HT5824 Im trying to make the appointments on the calendar in my phone transfer to the icloud.if i reset my documents in icloud, can or will it delete data on my iphone?

    Im trying to make the appointments on the calendar in my phone transfer to the icloud calendar on my PC. If i reset my documents in icloud, can or will it delete data on my iphone?

    Hi jordanpaulbrown,
    I apologize, I'm a bit unclear on the exact configuration you are currently using/describing. If you are talking about My Photo Stream, you should be aware that it only stores stores photos for 30 days in order to allow for other device to connect and download the photos. If you would like to keep them long term off of your iPhone, you may want to set up your computer (Mac or Windows) to automatically download them. You may find the following article helpful:
    iCloud: My Photo Stream FAQ
    If you are running iOS 8 on your iPhone, you may also find the following article about changes to Photos useful:
    Get help finding your Photos in iOS 8
    Regards,
    - Brenden

  • Trying to make the config for gensplash suppost :S

    Hello everyone im trying to patch the stock kernel of arch to get fbsplash working and im following the wiki topic about this matter http://wiki.archlinux.org/index.php/Gensplash , but the problem is that it it says i need to make the config with this options
    Which ever method you choose but be sure to choose the following settings at the config stage:
          Device Drivers
            Block Devices
              RAM disk support (BLK_DEV_RAM) = Y
                Inital RAM disk (initrd) support(BLK_DEV_INITRD)=Y
            Graphics Support
              Support for framebuffer devices (FB) = Y
                VESA VGA graphics support (FB_VESA) = Y
                  VESA driver type
                    vesafb (FB_VESA_STD) = Y                                        (see note 1)
                    vesafb-tng (FB_VESA_TNG) = N                                    (see note 2)
                "Card Specific" display support (FB_"CARD") = N                     (see note 3)
                Logo Configuration
                  Bootup logo (LOGO) = N
                Support for the framebuffer splash (FB_SPLASH) = Y
    and im making the config with xconfig , but i cannot find some options like for example
    VESA driver type
                    vesafb (FB_VESA_STD) = Y                                        (see note 1)
                    vesafb-tng (FB_VESA_TNG) = N                                    (see note 2)
                "Card Specific" display support (FB_"CARD") = N                     (see note 3)
    so rite now im thinking that maybe this options changed of subcategory or they do not exists anymore , i dont know :S
    maybe some of you would like helping me on finding this options as i think if they are not enabled the hole building process will end up on a not vesafb enabled kernel
    thanks for any help 

    The VESA driver type selection is only available if you also apply the vesa-tng patch, which is included in beyond, but is not necessary for gensplash. In other words, you can safely do without them.
    "Card Specific" display support refer to the options immediately after VESA VGA graphics support in the kernel config i.e. card-specific framebuffer drivers such as nvidiafb or radeonfb. Just make sure they are all turned off.

  • I am making a montage and I am trying to make the photos do the effect where they slightly move either to the sides or up and down while they are being shown. Not a transition but just something so that they are not all stagnant on screen. Any ideas?

    I know on Windows Movie Maker it automatically adds these glide effects to your montage, but it seems very complicated to do in FCP X. I downloaded Fx Factory but that seems difficult as well. This really shouldn't be very hard. Thank you so much and I look forward to getting some insight on this.

    do a search on fcpx "ken burns". It's built into FCPx but you can also do your own, manually. first, explore the ken burns effect.

  • How do I create a repeating curved pattern? I'm trying to make the grooves in tires.

    I'm working on a logo and I'm trying to create the tread marks on a tire. I'm having difficulties because of the tire is round and I don't know how to create a repeating shape with the right spacing and alignment on a circle.
    I hope this makes sense, I'm still quite new to everything. Let me know if I can help clarify anything!

    Mallory,
    An easy way to do it would be to (View>Smart Guides are your friends):
    1) With the Ellipse Tool (ClickHold the Rectangle Tool and see the options fly out) Alt/Option click the centre of the tire path (Smart Guides say center), then set the Width and Height high enough to make it outside the outer rim of the tire path, then remove Fill and Stroke;
    2) With the Selection Tool ShiftClick the circle from 1) and then the tread mark, and Ctrl/Cmd+G to Group them;
    3) Effect>Distort & Transform>Transform, setting Rotation to 360/N where N is the total number of tread marks, and setting Copies to one less (N - 1);
    To get rid of the circles, and to have actual tread marks:
    4) Select the Group and Object>Expand Appearance;
    5) With the Direct Selection Tool ClickDrag over the circles and press Delete twice.
    That will leave you with all the tread marks in a Group.

  • Trying to make the forums template in BC look attractive and publish it to my muse design. Help!

    I have published my Muse site through BC. I have a forums section that looks bland because I don't know how to make the BC forms template look creative. You can see my beta site at www.americanrollers.com Please help. I am trying to figure this out because my deadline is Dec 25th, 2013. My new site drops on Jan 1st, 2014.

    Thanks for your response. So I build the template into Muse, take that code
    and drop it into the BC page templates? Then wrap the BC forum template
    into the page that I created? I sound novice because I'm still learning the
    interaction between BC and Muse. Please respond, thanks again.

  • Please make the FGS add on available. it exists so don't lie and say it doesn't! Why is FF so anti gamers?

    FGS is a game simplifier that is available through Facebook FF pretends that the add on does not exist. I don't know why FF hates gamers and gaming but it is very annoying. Please don't make me go to the EVIL google Chrome browser

    OK you win.. I'm going to switch to Chrome. I hate it already but given your inability to create a functioning browser I don't have a lot of choices. You oughta shame yourselves for doing this to good followers. I've been with FF since version1.

  • Have apple tried to make the syncing of 2 iphone on 1 imac as difficult as possible? My nokia is a doddle. I cant back up my wifes 3gs without entourage. I iponed up a seperte log in on my imace and it still says my wifes is prev synced with another itunr

    By the looks of it I'm having the same problem as lots of people. Apple seem to have made the system of syncing and backing  up 2 iphones as difficult as possible. I have just bought an iphone4 and synced it to my imac. I now have my wife's apps and content. Now when it try to back up my wife's phone using a seperate log in on my imac and a new itunes install I'm asked " do you want to sync and erase all of the details on my wifes phone or do I want to erase and sync and loose all her data. No option not to!!!!   I thought it was maybe the inset of dementure but lots of people are having the same problem. How hard can it be to back up one phone at a time and only that phone?  Backing up my Nokia was a doddle!   I thought Apple were well know for. making things easy?  I have also tried backing up my wife's to a seperate itunes but you cant export her contacts etc unless I have office and entourage which I don't. I cant back up her phone as it is with all it content and apps and start from scratch as I get only the sync and erase and destroy option.  AAAGGGHHH

    1) authorize iTunes on your wife's user account for her iTunes store account(s)
    2) connect the device and right-click or control-click it in the iTunes Source list, then choose transfer purchases from the shortcut menu that appears.
    3) sync the device
    iTunes will wipe the iPhone but, since you transferred her purchases in the previous step, your content will be in her library and you can re-populate the iPhone with it.

  • I am using photoshop elements (8) for several years since I upgraded form (2). I am a mac user and just upgraded to yosimite.  Photoshop elements will not open.  I have tried to make the changes recommended by the Adobe website, but I can not locate them

    How can I get photoshop elements to work on my mac with Yosimite??

    Yes, that is correct. The organizer is just a database, so your photos are wherever you put them intially. Did you import from iphoto? In that case, organizer does make duplicates (to avoid writing into the iphoto library, which would be a Bad Thing to do). If you didn't specify a location, the copies that PSE uses will be inside subfolders in the Adobe folder in your Pictures folder.

  • Trying to make the switch from PC to Mac

    Hi, I just graduated from high school and I'm off to college so I've been doing some research on what kind of laptop to get. I'm heavily leaning towards the Mac but I'm looking for that extra nudge that makes me a believer after a life on PC. I tend to be pretty virus-prone so the fact that Mac doesn't really have a problem with that is a huge factor. I really like the style and aesthetics that Mac has and it's simplicity of use. I'm not so worried about making the switch in that aspect because I feel like Mac won't be a very complicated and overwhelming change from PC. I also like the deal that I would get a free iPod Touch upon purchase and a $100 cut in price (so I'm told by the man at the Apple store). I have been looking specifically at the Macbook Pro 13-inch. However, one thing that I hear a lot about is problems with compatibility. Apparently there are a good deal of programs that don't work well with Mac and I don't know which ones. I would like to know exactly what kind of programs these are. Will I be able to download music or movies on a Mac? run games like WoW (if I would ever decide to play it) or similar MMOs? If it's not too much to ask it would be nice if someone could point out what Macs can do that PCs can't or on the flip side what PCs can do that Macs can't - Pros and Cons are good too. I would really appreciate any help anyone could give me. Thank you.

    Hi Tower_Sage,
    I hope you realize that you are going to get an extremely Apple-biased viewpoint here . The choice between a Mac and PC is purely personal, and compatibility is generally not an issue. There are really only a few instances where compatibility becomes critical, and that is the requirements of your college, and games.
    First, my favorite, games:
    Most high-profile, big-budge titles eventually come out for Mac. Unfortunately sometimes the performance of the game suffers compared to the PC version. This is not because of some flaw or problem with Macs, but rather the amount of time and effort developers put on the game. EA uses a Direct X "wrapper" for many of its games, and this results in lower performance than on a comparable equipped PC. The few games I have played this way (Spore, C&C 3, NWN2) all played "good enough" on my Mac. Some developers (like PopCap and Blizzard) actually support Mac from the get-go, and these titles do not suffer at all. Another example that I just discovered today, PopCap and Blizzard have created a World of WarCraft themed Peggle game, however this is available for PC only (at least right now), so I can't play it on my Mac. Bottom-line, if games are a priority, you need to investigate if the games you want to play are on the Mac, otherwise you will need to run Boot Camp.
    School Requirements:
    My college specifically requires Microsoft Office 2003 (not earlier or newer versions like 2007) for coursework, and Internet Explorer. So, when I switched to a Mac (in early 2008) I faced a few hurdles. I am a "computer geek," and was able to work around the compatibility issues by using Safari, and Office 2004 (and later Office 2008) for about 98% of the issues. The biggest issues seems to be the individual professors and classmates, as if they are not able to open your Word or PowerPoint documents, then you of course can't get grade. However, the work-around for this, was to use the Save-As command and save the documents in the 2000/2003 format. If you remember to do this, you should be able to get by using the Mac versions of Office. One of my final courses, I absolutely had to have Internet Explorer due to some glitch on the school servers, as I was unable to turn in assignments using Safari. Make sure you check with your college and see what requirements they have.
    The only other "real" issue you will have, is software. Mac software is not sold everywhere, so you will end-up getting most of it online, unless you happen to live near an Apple Store (best place for Mac products, as far as selection goes). The advantage of getting software online, is that there is a lot of open source software that can be found for free.
    Lastly, your copy of Office 2007 will not run on your Mac, without using Boot Camp. Under Boot Camp, your Mac becomes a PC. This means you must have a Windows disc (with license) to use Boot Camp, and this forces you to share your Mac hard drive with two operating system. Unless your college supports Macs (many do), plan on getting a copy of Windows at around $150 along with your Mac. Depending on the monetary support you have, you may want to consider getting a copy of VMWare Fusion (http://www.vmware.com/products/fusion/) or Parallels Desktop for Mac (http://www.parallels.com/) for around $80 as well. This program will allow you to run Windows in a window on your Mac Desktop, and integrate Windows only program into the Mac experience. Plus, if you use Boot Camp, these programs can actually use that Windows install, allowing you to run in a window on your desktop, and if you need max performance (like for a game), you can re-boot into Boot Camp. This is how I currently run (with Parallels Workstation), and it solves 100% of the possible compatibility issues.
    Good luck!
    Rich S.
    Coming Soon: Wombat Computer Service (http://www.wombatcs.com)

  • My fairly new iMac has been giving me trouble with permissions. I tried to make the owner of the hard drive myself, instead of three groups I hadn't created. Now it won't start. I''ve tried safe boot and resetting the PRAM.. Nothing.

    Reset the PRAM, safe boot, removed everything but the key
    board. Gray spinning wheel.
    It started with me trying to change permissions. I'm the
    owner, yet it would give me problem when moving files from desktop to hard drive.
    Now it says library extensions are missing. I never
    touched the library.

    Hi Ralph - likely you're right. The section below, taken from their site, looked like it may offer some hope:
    Unlock what is rightfully yours
    BatChmod can also give you back access to locked files, folders or disks. If something is locked, it can unlock it. If you no longer have permissions to files or folders, change the permissions back.
    Sometimes, a whole hard disk can become inaccessible or locked and often, BatChmod can unlock those too!
    If you moved a folder or files from another machine or another user on your machine, BatChmod can help set you up as their rightful owner.
    As you say, a re-install is probably the best way to go, but I thought that given that nothing's working correctly now it might be worth a go. If it fails desiree274 can still proceed with a re-install.

Maybe you are looking for