How to share array(list)/variables between tabbed pane in Java swing?

As I can see, you share user between Register and Process So the problem is how to refresh Process when data in user are updated. You could create listener on User or on 'Register'. IMHO listener on 'Register' is more elegant.

As I can see, you share user between Register and Process. So the problem is how to refresh Process when data in user are updated. You could create listener on User, or on 'Register'.

IMHO listener on 'Register' is more elegant. RegisterListener: public interface RegisterListener { void userRegistered(User user); } Register: public void addRegisterListener(RegisterListener listener) { //add listener to some collection. } //Call this method on Submit button press protected void fireRegistered() { //iterate over collection of listeners and on each do: listener.

UserRegistered(user); } Process: Process implements RegisterListener { public void userRegistered(User user) { refreshView(); } } And in main: Register register = new Register(user); Process process = new Process(); register. AddRegisterListener(process); So Process should be informed when user is registered, and it should receive all the necessary data in user parameter of listener method.

SOrry, if I am too stupid – web_starter Aug 22 '10 at 10:09 In Java, every class or interface has to be in separate file. Except when we make inner class or interface, but this is not the case here. What pane don't you know where to add?

JTabbedPane? Nothing changed here, add it to JFrame like before. – amorfis Aug 23 '10 at 9:57.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions