Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Transfering data between two JFrames  RSS feed

 
Mikael Andersson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Allright, I have a project going on which require me to move some data between different JFrames (which are also different classes).

What I want to do in particular is take an Object which I've created in one window and move all that information on to the next window. I've asked this question on other boards with no valid answers.

So say you got 2 classes with JFrames and one class describing an object. The object is created in class 1 and when you press "OK" in the frame @ Class 1, the frame of Class 2 opens and you have all the information at your disposal.

Thanks in advance!
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On quick glance, this sounds less a Swing issue and more an OOP design issue. You have class1 instantiating class2 and want to pass an object from class1 to class2. Couldn't class2 have a field variable of the object to pass and you either pass it via class2's constructor or some setter method? If I'm missing something, then please re-ask your question with more specific info (if possible) and showing some code or pseudo-code that really demonstrates the issue.

Good luck!

Pete
[ March 29, 2007: Message edited by: pete stein ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!