Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
刷新gui java中的复选框_Java_User Interface_Checkbox_Refresh - Fatal编程技术网

刷新gui java中的复选框

刷新gui java中的复选框,java,user-interface,checkbox,refresh,Java,User Interface,Checkbox,Refresh,我来这里是因为我总是疯狂地查看我的代码,并试图找出我做错了什么 我想我需要一些帮助和你的新眼睛来帮我 问题是。。。我正在浏览一系列复选框,当单击复选框时,将显示一个新复选框。->这很有效。 当我完成后,我想点击一个刷新按钮,并且复选框应该像开始一样重置。 重新开始。 但我不明白怎么 这是侦听复选框的代码 /** Listens to the check boxes. */ public void itemStateChanged(ItemEvent e) { Object sou

我来这里是因为我总是疯狂地查看我的代码,并试图找出我做错了什么

我想我需要一些帮助和你的新眼睛来帮我

问题是。。。我正在浏览一系列复选框,当单击复选框时,将显示一个新复选框。->这很有效。 当我完成后,我想点击一个刷新按钮,并且复选框应该像开始一样重置。 重新开始。 但我不明白怎么

这是侦听复选框的代码

    /** Listens to the check boxes. */
public void itemStateChanged(ItemEvent e) {
    Object source = e.getItemSelectable();

    if (source == chinButton) {
        System.out.println("Chinbutton Pressed");
        glassesButton.setVisible(true);
        lblPass.setForeground(Color.green);
        chinButton.setEnabled(false);


    } else if (source == glassesButton) {
        System.out.println("GlassesButtonPressed");
        lblNewLabel_5.setForeground(Color.green);
        hairButton.setVisible(true);
        glassesButton.setEnabled(false);

    } else if (source == hairButton) {
        System.out.println("hairButtonPressed");
        teethButton.setVisible(true);
        lblNewLabel_6.setForeground(Color.green);
        hairButton.setEnabled(false);

    } else if (source == teethButton) {
        System.out.println("teethButtonPressed");
        chckbxTested_1.setVisible(true);
        lblPass_1.setForeground(Color.green);
        teethButton.setEnabled(false);

    } else if (source == chckbxTested_1) {
        System.out.println("chckbxTestedButtonPressed");
        lblNewLabel_9.setForeground(Color.green);
        System.out.println("chckbxTestedButtonPressed2");
        chckbxTested_1.setEnabled(false);
        btnSavePdfprint.setVisible(true);
    }


}
如果有人能帮我解决这个问题,我将不胜感激


谢谢

您显示的代码不足以帮助我们。您还可以显示面板是如何复位的吗?按钮是如何构建的?“当我完成后,我想单击一个刷新按钮,复选框应该像开始一样重置。”在问题中包括您为该刷新按钮编写的任何代码。您可以使用位于问题下方阴影关键字矩形下方的“编辑”链接编辑您的问题。