问题描述
我创建了一个简单的演示数据传输程序。
i想要运行主类文件,当我点击按钮时。
我的班级名称是invoicegenerator
和
i有一个名为invoicebuilder的框架类。我也将菜单插入invoicebuilder。
在invoicebuilder下有一个名为invoiceMaker的内部框架
并且该invoiceMaker内部表格中有几个按钮。
所以现在我想点击invoicemaker表格上的按钮
它应该运行invoicegenerator类而不关闭任何背景表格。
我尝试过:
private void cusCancelBtnActionPerformed(java.awt.event.ActionEvent evt)
{
InvoiceGenerator obj = new InvoiceGenerator();
String [] args = {};
obj.main(args);
}
当我点击打印按钮时,这将运行InvoiceGenerator类。但它会关闭表单窗口。
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.
这篇关于点击按钮后运行java类文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!