How to Pass Data from One frame to Another and to all other frames in the project?
<p>I wanna want to pass or share data(values) from login frame to all frames in my project, H have made class of this variables like this  </p>

<pre><code>public class SharedData {

    public  String LoginName;

    public SharedData() {
    }

    /**
     * @return the LoginName
     */
    public String getLoginName() {
        return LoginName;
    }

    /**
     * @param LoginName the LoginName to set
     */
    public void setLoginName(String LoginName) {
        this.LoginName = LoginName;
    }
}
</code></pre>

<p>and from the first frame (login frame) I make object of this class and sets its username like this</p>

<pre><code> public  SharedData  data1=new SharedData();
    data1.setLoginName(Username_Login.getText().toString());
</code></pre>

<p>and from the second frame i get the value :</p>

<pre><code>public  SharedData  data=new SharedData();
ogin_labelName.setText(data1.getLoginName().toString());
</code></pre>

<p>But finally it doesn’t work ... what is the problem or any solution ?</p>

<p>thanks in advance</p>
