This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes calling function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "calling function " Watch "calling function " New topic
Author

calling function

amrit sharma
Greenhorn

Joined: Apr 05, 2010
Posts: 8
hii..
i want to know how can i call a function of a different class using actionlistener event ....and how can i switch between different functions on the selection of a radiobutton..

plse help..

amrit
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
amrit sharma wrote:hii..
i want to know how can i call a function of a different class using actionlistener event ....and how can i switch between different functions on the selection of a radiobutton..

plse help..

amrit


Well, you're not providing enough information here to understand what you really want. Additionally, it seems you're asking two separate questions. It would be best to ask each question in its own Topic.

If the method is static (a class method), you can just prefix the method name with the class name. If the method is an instance method, you need a reference to the object instance. How you get that depends on the details of your application.

Perhaps you could provide some more details and show what you've tried and what result you're getting?

As for the radio button, have a look at the tutorials provided by Sun. Using Google, I just searched for Java Radio Button Tutorial and the very first hit is a tutorial provided by Sun. Give it a try.
 
jQuery in Action, 2nd edition
 
subject: calling function
 
Similar Threads
how to invoke function written in one suit in another suit
calling function from another function
external access to variables of a different scope
object literal + prototyping
How to dispatch different web pages by clicking ddifferent buttons in Form