0

I don't have any trouble in making the frames themselves. The issue that I am stuck on is how to differentiate between which frame to pull up.The program I am writing begins with a login frame and then based off what the user enters it pulls up the associated frame. For instance if the user is a student then after the login frame they would see the new student frame with the available options for them. Or if the user is an instructor than after they enter their credentials the new instructor frame pulls up with there options. Like I said above I can make the frames no problem I am just unsure how to differentiate between them after the login frame

mKorbel
  • 109,525
  • 20
  • 134
  • 319
ZP20
  • 9
  • 4

1 Answers1

0

From your explanation, you could keep your frames in a sort of Map. Frames will be assigned to values, frame names will be assigned to keys. Then, you will be able to call :

map.get("student").show();
map.get("teacher").show();

Or, you could get loginType from the user names :

map.get(loginType(username)).show();

private abstract String loginType(String userName);
Ozgen
  • 1,072
  • 10
  • 19