• Post Reply Bookmark Topic Watch Topic
  • New Topic

URGENT PLEASE

 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actaully what i am doing i ve one internal frame in whihc i am using JSplitPane, so i am calling two different classes in that. So what i am trying to do that if i click class 1 button1 it also call the class 2 button 2 also. So that i update my JTable.

But class1 and Class2 are separate classes.

Please.....help me

thanks
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a lot of ways to link classes together so that they can communicate among one another. An easy way is to pass a reference from one to the other. Usually you do this in the class that instantiates and assembles the two. CommTest puts the two classes Left and Right together and is a logical place to pass the reference of one to the other.
 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you ver much! i am new to swing so little bit confused and ....
thanks once again
 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once again,
Craig , consider your example. let suppose class Right also has JButton. I want to call from class Left(JButton) action performed to class Right actionperformed by using Left class JButton.

Thanks, i looking forwar you reply !
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Craig
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!