Hello, can anyone help me how to get jcheckbox value state from a different class to perform a task that will be call display in the frame of the first or former class.
Find bellow my codes for attempting to do this.
Diagoniser2 jf = new Diagoniser()
JCheckBox headck = new JCheckBox();
JCheckBox coldck = new JCheckBox();
JCheckBox urineck = new JCheckBox();
JCheckBox dizck = new JCheckBox();
JCheckBox visionck = new JCheckBox();
public void actionPerformed(ActionEvent e){
if(e.getSource()==diaBtn)
{

if(headck.isSelected()&& fatck.isSelected()&&cougck.isSelected()&&appck.isS elected()){
JOptionPane.showMessageDialog(null, "Typhoid Suspected");
}
}

2. Second class
public Diagoniser3(){
Diagoniser2 tret2 = new Diagoniser2();
tret2.setVisible(false);
if(e.getSource()==tret2.treatBtn){
if(tret2.headck.isSelected()&& tret2.fatck.isSelected()&&tret2.cougck.isSelected( )&&tret2.appck.isSelected()){
JOptionPane.showMessageDialog(null, "Typhoid Suspected");
}
else
{
JOptionPane.showMessgeDialog(null, "Symptom not well defined");
}