Need help -how to use a GUI to compile a file

hello peeps,
I have this problem, let's get directly into it, i have a program that has GUI with a Text Area that im going to copy a text file into it (using JFileChooser FileReader and readLine() ...) so i have radio buttons like (view, compile and execute) and an OK button to get the selected option, what i want to know is how to compile the file that is in the text area, like how to get to the MS-dos console and javac to start. i hope this description is clear, and i'll be very appreciative for any help!

thanks for your response, but its not working it keeps on throwing IOException, i tried to put a direct string into it like (Runtime.getRuntime().exec("javac MyClass.java"); and same thing happend. Am i missing something? like is there something to add before calling that line of code? i did import Runtime
ok here is how my code looks like:
   if(compile.isSelected())
                   try
                   //name of the file im pasting into the text area  
                   String filename = file.getName();
                   Runtime.getRuntime().exec("javac" + filename);
                   catch (IOException e)
                     System.out.println("error compiling program");
               }

Similar Messages

Maybe you are looking for

  • T5120 cable management arm and exhaust air flow obstruction

    Hello Folks Concerning Sun servers of 1-U in height... There is debate as to whether the effectiveness of heat transfer out of the chassis is actually impaired by the use of a cable management arm at the rear of a rack mounted server. From my experie

  • Just purchased Xcelsius Server 2008 and it will not open

    I have been using the xcelsius 2008 server trial edition and decided to purchase the full product.  After I paid, I received a product key and a link to download.  When I open the trial version, it has a link to enter a product key, so I entered the

  • Hierarchy upload-InfoPackage-Hierarchy Selection tab

    I have to upload hierarchy for Internal Order. I have InforPackage but on the Hierarchy Selection tab there is no hierarchy that I am supposed to upload (it's called A1). Do I have to extract the missing hierarchy from R/3? Can someone please provide

  • Fonts in flex/flash

    I posted this question over at actionscript.org but It might suit this forum more: I'm trying to create an application with AIR but there is one thing that keeps bugging me and its the vector based fonts, even though I select arial 12px font-weight n

  • Multi Currency in Sales Opportunities

    Hi Experts..... If local currency is INR and system currency in EURO then in sales opportunity I want to create new transaction with USD currency. But the potential amount of sales opportunity displays in either local or system currency only. Then ho