Forums Register Login

Updating an object from one class in another one

+Pie Number of slices to send: Send
Hey Guys. I have quite a riddle how to update object from one class in another one. More precisely I've got a JTable in one JFrame (wchich is obviously editable and might have different amount of rows as well) and want to import data from it to a Jtable which is located in another JFrame. The question is rather overall since I don't know how to refresh Integer neither:) Thanks in advance

+Pie Number of slices to send: Send
If you truly want to access one from the other, all you need do is add a reference to the object: You can do this with a parent object or in a 3rd object that has a reference to each and utilizing a setter in each class.
+Pie Number of slices to send: Send
This is pretty clear for me. But I want to see changes in an object in the class C2 when object from class C1 is changed by user while program is working.
+Pie Number of slices to send: Send
Try it.

Adrian Lukaszek wrote:This is pretty clear for me. But I want to see changes in an object in the class C2 when object from class C1 is changed by user while program is working.

 
+Pie Number of slices to send: Send
Here ya go.

Adrian Lukaszek wrote:This is pretty clear for me. But I want to see changes in an object in the class C2 when object from class C1 is changed by user while program is working.

 
Water! People swim in water! Even tiny ads swim in water:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 603 times.
Similar Threads
JTable Cell Renderers
JTables
JTable ........
JTables
JTable selected row problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:34:03.