Message passing between gui components

K

kirikaphoenix

I'm a bit of a java newbie so you'll have to forgive me. I'm creating a
gui in Swing and have multiple parts of it split up into several
classes.
The problem im having is that I have data in JTextField's in one part
of the class that I need to read from another part of the gui that is
from another class. All of the gui's classes are instances but I don't
know how to reference each part of the gui in order to get that data.

I can't write a method to return the data as I don't have a non static
reference to call it from. An ActionListener wouldn't work as the field
is uneditable and just holds the data (the data itself is written into
the field by the class).

Is there a particular Listener or method message passing that I can use
to get the data?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top