public void actionPerformed(ActionEvent e) {
int i=0;
String s1 =" Others look at you as a person should be treated with caution \n May admire you,"
+"and everyone else would like to be like you, but do not trust you always,"
+" \n and are reluctant to form a deep relationship with you.";
String s2 ="Others look at you as a person is sensitive, careful, cautious, practical \n "
+".. To build social relationships can not quickly or easily, but dedicated to his friends,\n requiring them to reciprocity.";
String s3 =" Others look at you as a person is shy, concern, he can not take Decisions, needs to be sponsored by,\n"
+"always need to take him from Decisions, does not want to interfere in anything or anyone.";
if(e.getSource()==a)
i=i+2;
else if(e.getSource()==b)
i=i+4;
else if(e.getSource()==c)
i=i+6;
if (e.getSource()==end){
if(i<=10)
JOptionPane.showMessageDialog(null,s1,"Analysis of your personality is ",JOptionPane.PLAIN_MESSAGE);
else if(i>=11||i<=20)
JOptionPane.showMessageDialog(null,s2,"Analysis of your personality is ",JOptionPane.PLAIN_MESSAGE);
else if(i>20)
JOptionPane.showMessageDialog(null,s3,"Analysis of your personality is ",JOptionPane.WARNING_MESSAGE);
}
}البرنامج عباره عن اختبار 5 اسئلة وكل سؤال له 3اخنياري a-b-c والخيارات عباره عن JRadioButton
بحيث اذا اختار المُختبِر a يزود العداد i نقطتين واذا اختار b يزود 4نقاط وهكذا ...
بعد مايخلص المُختبِر من الاختيار يضغط على button (end)
وعمل if الثانيه هو : اذا كان العداد ( i<=10 ) يطبع لي s1 في dialog وهكذا كما موضح في البرنامج
abolkog & FAZ شكراً لكم مقدماً : )
