You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by "Greenberg, Gary" <gg...@visa.com.INVALID> on 2021/06/16 19:33:01 UTC

NetBeans and headless app.

I am developing a project that can run either locally with GUI or remotely using ssh or PUTTY.
In the main() method I have these lines of code:
        if (GraphicsEnvironment.isHeadless()) {
            // run in command line mode
        } else {
   // Initiate Swing JForm
        }
When I am debugging it Netbeans always open it in GUI mode.
Is there a way to imitate in the Netbeans headless environment or I need to change the code to debug it?
Thanks.

Gary Greenberg
Staff Software Engineer
Data Product Development, BI-A
E: ggreenbe@visa.com
M: 650-269-7902

[EmailSig-TaglineVersion]


Re: NetBeans and headless app.

Posted by Gregor Kovač <ko...@gmail.com>.
Hi!

Try https://www.oracle.com/technical-resources/articles/javase/headless.html

Best regards,

     Gregor

Greenberg, Gary je 16. 06. 21 ob 21:33 napisal:
>
> I am developing a project that can run either locally with GUI or 
> remotely using ssh or PUTTY.
>
> In the main() method I have these lines of code:
>
>         if (GraphicsEnvironment.isHeadless()) {
>
>             // run in command line mode
>
>         } else {
>
>    // Initiate Swing JForm
>
>         }
>
> When I am debugging it Netbeans always open it in GUI mode.
>
> Is there a way to imitate in the Netbeans headless environment or I 
> need to change the code to debug it?
>
> Thanks.
>
> Gary Greenberg
>
> Staff Software Engineer
>
> Data Product Development, BI-A
>
> E: ggreenbe@visa.com
>
> M: 650-269-7902
>
> EmailSig-TaglineVersion
>