can any one please tell how to write a text editor program in java for running and compiling of any given program

Recommended Answers

All 2 Replies

Have a JFrame with a JTextArea and the buttons: Save, Load, Compile, Run. And a way for the user to select a file for loading or saving. (JFileChooser)

The user will write his code in the text area and with the buttons you will perform the actions.
Save: You will read what the user entered and save to a file.
Do the same for the rest.

For compile and run, I would suggest you study how to run command prompt commands with java using the Process class. Just run the javac command to compile.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.