Question: I have two JFrames `login.java` and `account.java`   

I need to get the `username` from the `login.java` page and put it in a variable in the `account.java` `JFrame`. How can I do this in the Java NetBeans using the Swing?

Answer: 
Instead of Using JFrames for passing values between different forms you can use CardLayout which will persist your data which you have entered in the previous form.
All you have to do is Create a JFrameForm and add panels to it.
Well you have very nice way to do it.

Define new Static **Final Objects of that class.**
and Save that value into the Object.

and in other Class u can easily use that objects and as well as that values.
By using 

**CLASSNAME.OBJECT VALUE.**

use that.