xfl12345 / javafx-console

This project provides ConsoleView implemented with JavaFX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaFX Console

This library provides JavaFX console view class "jp.uphy.javafx.console.ConsoleView". The ConsoleView provides PrintStream and InputStream which linked to the console text. Therefore, you can replace System.in and System.out with console view.

Also, you can wrap CLI application with JavaFX console. It is convenient when you use javapackager command to your CLI applications.

Replacing System.in and System.out with Console View

final ConsoleView console = new ConsoleView();

System.setOut(console.getOut());
System.setIn(console.getIn());
System.setErr(console.getOut());

Wrapping your CLI Application

public class CliApplicationWrapper extends ConsoleApplication {

  @Override
  protected void invokeMain(final String[] args) {
    YourCLIApplication.main(args);
  }

  public static void main(String[] args) {
    launch(args);
  }

}

About

This project provides ConsoleView implemented with JavaFX.

License:Apache License 2.0


Languages

Language:Java 95.8%Language:CSS 4.2%