Each program has its own launch point, the main class with the main method, from which the main application thread starts. If the application has several such points, then the main class can be specified explicitly in several ways. To start the change of the main class at the IDE level.
To select a main class for an application with several classes containing the main start method, in the NetBeans IDE:
- Select a project in the list and click the right mouse button.

- The context menu is displayed, select Properties there.

- Next, the Properties window will open, go there to Run.

- Further in the Main class item there is a Browse button, on it and click, and select the class you need. Fix it with the Choose main class button and press Ok .

- Done!