import java.io.IOException;
import java.lang.Process;
import totalcross.ui.Label;
import totalcross.ui.MainWindow;
import totalcross.ui.gfx.Color;
import totalcross.io.LineReader;
import totalcross.io.Stream;
import totalcross.sys.Settings;
public class RunningCPP extends MainWindow {
setUIStyle(Settings.MATERIAL_UI);
// Label to show the results
label.setBackForeColors(Color.WHITE, Color.BLACK);
// Process initialization
byte[] output = "Take the output!!!\n".getBytes(); // convert string to
process = Runtime.getRuntime().exec("./io"); // execute your
process.getOutputStream().write(output, 0, output.length); // write output into
process.waitFor(); // blocking method
} catch (IOException ioe) {
} catch (InterruptedException ie) {
LineReader lineReader = new LineReader(Stream.asStream(process.getInputStream()));
while ((input = lineReader.readLine()) != null) {
} catch (IOException ioe) {
add(label, CENTER, CENTER);