我为学校项目创建了医院管理系统,我认为我占系统的35%,而在患者登记处,我遇到很多麻烦的是我在第一页上拥有的“ JFrame1”
第一首页我有此病史和其他症状的复习症状,因此,如果我不选中任何JCheckBox
控件(包括“无”复选框),但我单击下一个按钮,它将弹出如果您没有任何病史,则可以选择这样的代码
if(!jCheckBox1.isSelected() || !jCheckBox2.isSelected() || !jCheckBox3.isSelected() || !jCheckBox4.isSelected() || !jCheckBox5.isSelected() || !jCheckBox6.isSelected() || !jCheckBox7.isSelected() || !jCheckBox8.isSelected() || !jCheckBox9.isSelected() || !jCheckBox10.isSelected() || !jCheckBox11.isSelected() || !jCheckBox12.isSelected()|| !jCheckBox13.isSelected() || !jCheckBox14.isSelected() || !jCheckBox15.isSelected() || !jCheckBox16.isSelected() || !jCheckBox17.isSelected() ||
!jCheckBox18.isSelected() || !jCheckBox19.isSelected() || !jCheckBox20.isSelected() || !jCheckBox21.isSelected() || !jCheckBox104.isSelected() || !jCheckBox102.isSelected() || !jCheckBox100.isSelected() || !jCheckBox98.isSelected() || !jCheckBox111.isSelected() || !jCheckBox94.isSelected() || !jCheckBox95.isSelected() || !jCheckBox99.isSelected() || !jCheckBox109.isSelected() || !jCheckBox112.isSelected() || !jCheckBox110.isSelected() || !jCheckBox97.isSelected() ||
!jCheckBox107.isSelected() || !jCheckBox101.isSelected() || !jCheckBox106.isSelected() || !jCheckBox96.isSelected() || !jCheckBox105.isSelected() || !jCheckBox92.isSelected() || !jCheckBox103.isSelected()|| !jCheckBox93.isSelected() || !jCheckBox105.isSelected() || !jCheckBox115.isSelected() || !jCheckBox114.isSelected() || !jCheckBox113.isSelected() || !jCheckBox121.isSelected() || !jCheckBox120.isSelected() || !jCheckBox119.isSelected() || !jCheckBox118.isSelected() ||
!jCheckBox117.isSelected()|| !jCheckBox116.isSelected() || !jCheckBox127.isSelected()){
//JOptionPane.showMessageDialog(null, "Medical History is empty","Error",JOptionPane.WARNING_MESSAGE);
int yesOrno = JOptionPane.showConfirmDialog(null, "No medical History?", "Proceed",JOptionPane.YES_NO_OPTION);
if(yesOrno == 0){
jCheckBox127.setSelected(true);
PARENTPANEL.removeAll();
PARENTPANEL.add(ALLERGIES);
PARENTPANEL.repaint();
PARENTPANEL.revalidate();
jCheckBox1.setEnabled(false);
jCheckBox1.setSelected(false);
jCheckBox2.setEnabled(false);
jCheckBox2.setSelected(false);
jCheckBox3.setEnabled(false);
jCheckBox3.setSelected(false);
JOptionPane Popup even when I already select one
我已经选中了复选框,然后单击“下一步”,但始终显示弹出窗口。
答案 0 :(得分:1)
在||
子句中将&&
更改为if
可能会救您。