Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have created a simple demo data transfer program.
i want to run main class file, when i click the button.

my class name is invoicegenerator

and
i have a frame class called invoicebuilder. i have insert menu's into invoicebuilder as well.
under invoicebuilder there is an internalframe called invoiceMaker
and there are few buttons in that invoiceMaker internal form.
so now i want to click the button on invoicemaker form
and it should run invoicegenerator class without closing anybackground forms.

What I have tried:

private void cusCancelBtnActionPerformed(java.awt.event.ActionEvent evt)
{
InvoiceGenerator obj=new InvoiceGenerator();
String[] args = {};
obj.main(args);
}
this will run the InvoiceGenerator class, when i click print button. but it will close the form window.
Posted
Updated 3-Jul-16 22:01pm
v4
Comments
Richard MacCutchan 22-Jun-16 3:02am    
What is the problem?
Hemas Ilearn 22-Jun-16 3:40am    
example:
test class 1
test class 2

i want to run test class 1 files in test class 2
Richard MacCutchan 22-Jun-16 6:30am    
You still have not explained what the problem is; only what you want to do. Does it work, and if not, what errors do you see?

1 solution

I suppose you want to run a Java program from another (Java) one. See, for instance, runtime - Running a java program from another java program - Stack Overflow[^].
 
Share this answer
 
Comments
Hemas Ilearn 4-Jul-16 3:27am    
this will run the program?
but it will close my all frames?
i need to run the class and keep remain the frame?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900