aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Associate a java code to a button --  please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Associate a java code to a button --  please help" Watch "Associate a java code to a button --  please help" New topic
Author

Associate a java code to a button -- please help

Foni kumar
Ranch Hand

Joined: Sep 19, 2007
Posts: 66
Hi all,

I have a java code to create an excel sheet automatically named createexcel.java . Suppose I want to create a button and link that button to this java code so that upon double click of the button the java code should run automatically and create the excel sheet.

Can any one guide me how can i tackle this scenario (At this point of time I have just the java code with me createexcel.java ) but i am unable to implement the rest of the part i mentioned. It. will be great if someone can provide some sample codes just to have an idea

Appreciate you help in this regard.
Thanks and Regards,
Debashis
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

You mean something like:
Foni kumar
Ranch Hand

Joined: Sep 19, 2007
Posts: 66
Thankyou Koen for your reply ,the shell function in java is mainly used for routine based tasks. Now can we include this under our button functionality(in AWT/SWT) so that onclick event initiates the execution of the java class. On double click of the button i want the code to execute the functionality..

Kind Regards
Deb
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4542
    
    5

Read the API for JButton and follow the link to the tutorial on How to Use Buttons, Check Boxes, and Radio Buttons.


luck, db
There are no new questions, but there may be new answers.
 
Don't get me started about those stupid light bulbs.
 
subject: Associate a java code to a button -- please help