• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to use a frame in place of console to compile and run any java program????  RSS feed

 
saurabh agr
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to create a GUI application in which i divide the frame into two parts, one part is like notepad where user can write there java code, and the other part i use for output display as displayed on console, i also want to provide two buttons one for COMPILE and anathor for RUN, when user click on compile button all that displayed on console should be displayed on my second part of frame, and if every thing is ok on click of run button the output should also displayed on second part of frame, means i dont want to use console my application should do all.

my problem is that how i can get all the things displayed on console to print them to my frame. can anybody help me???
 
Don Blodgett
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For running the script you could use the Java implementation of javax.script.ScriptEngine, from there redirect the System.out to a PipedOutputStream which is connected to a PipedInputStream which you read from your console thread and then output to your console area.
 
saurabh agr
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don Blodgett wrote:For running the script you could use the Java implementation of javax.script.ScriptEngine, from there redirect the System.out to a PipedOutputStream which is connected to a PipedInputStream which you read from your console thread and then output to your console area.


can you please provide a code snippet.....
 
Don Blodgett
Ranch Hand
Posts: 61
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!