What my program is suppose to do is when the user logs into the system, the username which they have entered should be stored in a second class. The reason for this is the username will be used to display at the top right corner of every JFrame which is opened.
So all I want to know is how do I store the username in a class (Named userLogin.java) which is in the background, so when the user opens for example inventory JFrame the username from the userlogin will be displayed in a textbox, then if they proceed to for example salesList JFrame, the username will be called from the userlogin class and displayed in a textbox on this JFrame.
Here is my coding for userlogin.java
public class userlogin{
//declare user strig for logged on user
public String users;
//default contructor
public LoggedonUser()
{
}
public void setUser(String loggeduser)
{
users = loggeduser;
}
}
How do I alter this class in order to store and hold user input for calling from any JFrame throughout the system use.
Much appreciated for the help, to get this to work :)