Java: Pass values from a Frame to a Dialog From

Hi Sirs,

I have a main frame and a dialog form which is called from the main frame with some key values from the main frame.
Here is my code from the main frame calling the dialog form. Unfortunately, those key fields come empty in the dialog form.
if (canProcessItem()) {
                MouvemComptaItems mouvemItems = new MouvemComptaItems(null, true);
                mouvemItems.setKeyAction(this.keyActionItem);
                mouvemItems.setKeyNumero(ef_numero.getText());
                mouvemItems.setKeyUserID(ef_userID.getText());
                mouvemItems.setKeyMonnaie(ef_codemonn.getSelectedItem().toString());
                mouvemItems.setKeyItemID(this.keyItemID);
                mouvemItems.setVisible(true);              
            }

Open in new window

Regards
Omer-PitouAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zzynxSr. Software engineerCommented:
I don't get what you're trying to say.
What is your dialog and what is your main frame in that (too small) code snippet?
Omer-PitouAuthor Commented:
Let s say I have a frame1. on frame1 I have a button calling a dialog form.
The code above is executed when the user clicks on the button from frame1. It calls the dialog form, and on the dialog form, the ID Number is displayed, and that value comes from frame1.
i.e. frame1= Main UI for invoice processing
Dialog= Detailed lines of the invoice
Omer-PitouAuthor Commented:
Nevermind, I found a solution, I loaded the values into an Object and pass the object as a parameter in the constructor of the dialog form.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

zzynxSr. Software engineerCommented:
OK. That sounds way better to me ;-)
Btw, as far as I know, you can close this question by accepting your own comment as the answer.
Omer-PitouAuthor Commented:
Thanks
Omer-PitouAuthor Commented:
I passed my object as a parameter in the constructor of the called dialog form
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.