Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Saving states across JFrames

Tags:

java

swing

I am trying the save the state of a previous frame and then carry it over to the other frame. More like saving the data of the textfields and areas so that when i press next button some text fields,and variables will be initialized in the next forms Labels and when you press back your previous data will still remain in your form inteface.Pls help

More like data binding but across different forms

like image 688
nnanna Avatar asked Jul 22 '26 18:07

nnanna


2 Answers

You can use any varible for that, and pass it as parameter to every JFrame you create.

But it sounds more like you want to use a CardLayout for your JFrame and use different cards that can be shown for the user. See How to use CardLayout.

like image 68
Jonas Avatar answered Jul 25 '26 07:07

Jonas


If you are trying to create a wizard like UI, you should look up Sun(oracle)tutorial here.

like image 21
ring bearer Avatar answered Jul 25 '26 06:07

ring bearer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!