• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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's fun to be me, and still legal in 9 states! Wanna see my tiny ad?
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic