Answer the question
In order to leave comments, you need to log in
How to find out in a Java program which mode is running: console or GUI?
My program is written in Swing (i.e. there are forms that open when the program starts). I also need to run the program in console mode without running these forms. I implemented this using the xvfb program. It launches the program and executes the code, but only what I wrote with System.out.println() or the like is displayed in the console. It is necessary for me to execute one function in the program either on pressing of the button, or at start from the console. I would like to know how to find out which mode is running? (in the program code)
Answer the question
In order to leave comments, you need to log in
Write 2 implementations and, by the cmd parameter, launch either new Frame or some console one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question