Depending on a command line argument or virtual machine argument I’d like my application to start in an invisible mode. It does the same things in both cases, except that in invisible mode it simply doesn’t display anything.
I can make the main program window invisible using JFrame.setVisible(false). However, then I have to find every place in the code, where for example a warning message pop-up is opened etc. (there are a lot of those!).
Is there a more general way to do that? May-be something like the headless mode (which of course throws HeadlessExceptions which is not what I want).
Thanks!
What does your applications architecture look like? If it is cleanly separated then create a new View layer that does nothing.
If it is tangled up together, the best option would be to un-tangle it and then create a new view layer that does nothing.