Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing a class from an applet 1

Status
Not open for further replies.

Dins19

Programmer
Aug 15, 2001
6
GB

I have a simple applet with a button. When the button is clicked i want it to excute a class ( which has a main() function in it ).

Could anyone please tell me how to do this or give me an example of the code.

Thanks a lot.
 
I'm not sure if it's an applet issue (I don't deal with applets too much), but you should be able to call the main function as you would any other static function.

So, if your class was called TestClass, you would run the function with:

TestClass.main(null);

The null argument is necessary since the standard argument set for the main function is String[] args.

I know this works outside an applet. Let me know if that works for you in an applet.

Hope that helps,

Mike Lundin
michael.lundin@summitsite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top