I have 3 classes that I have written some part of them below.when i write`this statement in AddStudent class ,it will show abcd1234 which is the password, but when I write it in the MainFrame class it will return null.why??? (I send my management object from MainFrame to the AddStudent with AddStudent's constructor) (I need the management object's information which is created in the AddStudent class in the mainframe ) what should I do?
management.getStudentsPassword();
my AddStudent class:
public class AddStudent extends javax.swing.JDialog {
private SystemManagement management;
/** Creates new form AddStudent */
public AddStudent(java.awt.Frame parent, boolean modal, SystemManagement management) {
super(parent, modal);
initComponents();
this.management = management;
}
my MainFrame class:
public class MainFrame extends javax.swing.JFrame {
/** Creates new form MainFrame */
private SystemManagement management;
.
.
.}
my SystemManagement class:
private String studentsPass;
...
public void setStudentspassword(String password){
studentsPass = password;
}
public String getStudentsPassword(){
return studentsPass;
}