I need my Java program to have two display modes: a GUI interface and a command line interface. If I run it in Windows, OS X, or another graphical environment I should get
I was looking for te same solution and came up with simply use an argument so when i run my program from comandline the args differs in length
if(args.length > 0) { System.out.println("command line mode"); }