-1

I'm creating a simple notepad (just like a clone of the real one). As an advancement I decided to add a Java compiler and Runner in the app making it a very basic IDE. My problem is how to I tell Java that System.out.prinltn() should print it's results in my own console?

I know the question is short but this is what i wanted to know. Not only for System.out.prinltn() but for all the other things which are printed in the console.

Thanks in advance

Ruthvik
  • 790
  • 5
  • 28
  • write more detailed. – KUTAY ZORLU Oct 15 '21 at 14:30
  • Sorry I didn't understand the meaning of `more details`. I said in the question that this small description actually explains what I wanted. – Ruthvik Oct 15 '21 at 14:32
  • What is **console**? Are you running on terminal? Some IDE? Have you created your own console? – Dilermando Lima Oct 15 '21 at 14:34
  • 3
    `System.out` is the Java wrapper for *standard out*. You can redirect standard out to wherever you want. See [Capturing contents of standard output in Java](https://stackoverflow.com/q/5389632/3890632) – khelwood Oct 15 '21 at 14:36
  • As i mentioned i made a basic notepad type IDE which contains a `JTextArea` as the console. My doubt is how to ask Java to print whatever it wants to print in the console in my CUSTOM CONSOLE. – Ruthvik Oct 15 '21 at 14:36
  • How about calling both if you need add in textArea and print on console `getTextArea().append("your text");` and `System.out.prinltn("your text")` ? – Dilermando Lima Oct 15 '21 at 14:41
  • Sorry but i mentioned it is a type of a basic IDE, I'm not calling the `System.out.println()` while typing the program but the Java Interpreter itself while running prints in MY CONSOLE. – Ruthvik Oct 15 '21 at 14:45
  • 1
    I'm pretty sure this is what you're looking for: https://stackoverflow.com/questions/14706674/system-out-println-to-jtextarea. Does this solve your problem? As stated in the comments - as it seems, you are trying to redirect the standard output stream. – InSaNiTy Oct 15 '21 at 14:54

1 Answers1

0

You need to pass arguments to the your notepad application.

For that you need to use windows controllers to access your notepad application from another java application.

IF both of the application written in java then you can use TCP ip at the backrground to communicate. This is the only one way, there are alot of other ways.

KUTAY ZORLU
  • 93
  • 1
  • 9