Hi.
This is not something easy to explain in a post, but I'll give it a shot.
You don't specify whether you're using Swing, AWT, SWT, or whatever. I'll try to explain it in some general way, I have only done some SWT.
You should have a model, which encapsulates the data that you want to pass around between the forms. For example, a "
User
" class. This class would contain the username, whether login was successful, and any data that you want to keep in it.
Your log-in form, say class
LoginWindow
, should have a getter for the
User
instance. Now, to pass the
User
instance to the second form, you could do it through it's constructor, a setter, or maybe you could make the
User
class a singleton (
http://en.wikipedia.org/wiki/Singleton_pattern[
^]).
There are many ways to achieve what you're after, I'm showing at least one.
Hope this helps you.