Odd Java programming bug

I have a program written in Java I’m working on that has developed an odd behavior. FWIW, Netbeans is the development environment, which may be relevant.

There are 3 tabbed screens to the GUI, the first of which starts communication with another computer, either by network socket, or by serial link. The problem happens regardless of communication type.

When the “Connect” button is pushed, another version of the program starts up. If I switch to the new one and repeat the connect, yet another version starts. If I kill the new instance and go back to the original, I can create another instance.

If I add code to the button to kill the new process, the new instance creates, then exits, leading me to think there’s a problem with the screeen properties, and not the code I’ve written. I certainly didn’t add any code to do this, and perusal of the screen properties doesn’t have anything blatant that might cause this.

I’m stumped. Any Java experts that can give me a hand?

Post the code in the Connect button’s ActionListener.

I THINK i found the problem. In reworking some of the logic to the connect button that is supposed to keep everything to either serial or socket, I left some brackets out that started a subprocess, and that spawned the whole new instance.