• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Updating an object from one class in another one

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Adrian Lukaszek
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Les Morgan
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Les Morgan
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
reply
    Bookmark Topic Watch Topic
  • New Topic