Class instantiation

23 views
Skip to first unread message

shop.servic...@gmail.com

unread,
Jun 27, 2019, 1:31:00 PM6/27/19
to CodenameOne Discussions
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA NetBeans 8.2
Desktop OS Windows 10 Pro
Simulator Latest
Device PC, Android, IOS

I think I'm having a brain fart here,

I have a form that populates a container that instantiates a container class, call it "a3VehicleRoInfoRecord", I hold a private instance of it in my form.
"private A3VehicleInfo a3VehicleRoInfoRecord = null;"
A3VehicleInfo a3VehicleRoInfoRecord = new A3VehicleInfo(…..);

Within the form a user can open a Dialog that can create a new local a3VehicleRoInfoRecord class and view its data (Data in this instance can change)

It appears that the first instance is overwritten by the second instance. However I have looked at this for some time and am not clear why. (reference changes)

The 2 instances are completely separate.
A3VehicleInfo a3VehicleRoInfoRecordSecondInstance = new A3VehicleInfo(…..); 

This is allowed in Swing w/o issue.

Is there something I am missing here?

Thoughts?

Best Regards.


Shai Almog

unread,
Jun 27, 2019, 11:33:28 PM6/27/19
to CodenameOne Discussions
This is valid in Java and should work without a problem.

shop.servic...@gmail.com

unread,
Jun 28, 2019, 8:28:18 AM6/28/19
to CodenameOne Discussions
Thanks.
Reply all
Reply to author
Forward
0 new messages