You have two different instances of Settings
class - one in SendMail
, the other in EmailClient
. Changing one instance will not affect the other. Create a constructor in SendMail
that accepts a Settings
instance:
public SendMail(Settings settings) {
this.setfrm = settings;
initComponents();
}
and edit initialisation of SendMail
in EmailClient
:
Settings set=new Settings();
SendMail sm=new SendMail(set);
public EmailClient() {
initComponents();
}
Thus, you make sure that both SendMail
and EmailClient
use one and the same Settings
instance (google about references in Java for more information).