Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have an pdfgenerator.java file with a main class.

and i have a form with a button.
now i want to run that java file when i click the button.

it says can't find symbol.

do i want to pass a varible from form to that java file or any other way.


Java
private void pdfGenerateActionPerformed(java.awt.event.ActionEvent evt) {                                            
 
        PdfGenerator pdfgen = new PdfGenerator();
        pdfgen.run();
 
    }


What I have tried:

i have try to run that java file using these code..
but it gives me an error

PdfGenerator pdfgen = new PdfGenerator();
pdfgen.run();
Posted
Updated 29-May-16 18:39pm
v2
Comments
Richard MacCutchan 30-May-16 3:44am    
What error, on what line? Please provide proper details about your problem.

1 solution

First compile the source pdfgenerator.java into a class file pdfgenerator.class
then call its main method like this:
<pre>Pdfgenerator.main();</pre>
Essentials, Part 1, Lesson 1: Compiling & Running a Simple Program[^]
 
Share this answer
 
v3

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