• Post Reply Bookmark Topic Watch Topic
  • New Topic

how one class Action Listener (button) call another class actionlister button  RSS feed

 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can plz someone help me, i m trying to call action listener(button) of class two when i pres the button of class one.
 
purushottaman dwarkanathan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To the actionlistener call on button1 say

button1.addActionListener(new ActionListener(Class2));

Assuming that Class2 is a inner class in the main class, pass an instance of class2 implementing the ActionListener.
 
ghazanfar khan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!