Why unmark the main class creation when we work with canvas?

Asked

Viewed 170 times

2

So far, in all tutorials I’ve seen, when we’re going to work with a swing screen, we’re asked to clear the main class creation.

I would like to know the science behind it, and what results if I don’t do it in such a way.

Edit: Ta na mao, hope visible

inserir a descrição da imagem aqui

  • 1

    Uncheck what? It’s been a while since I’ve done java-swing and I’ve never seen it. I could explain it better?

  • Giovane, you can show a screenshot than you have to "clear"?

  • Sure, I’ll send the screenshot

  • Quiet. Just note that you need [Edit] the question to add the screenshot, do not need to do another post =D

1 answer

4


There’s nothing wrong with doing that. What happens is that a lot of people prefer to create the project from scratch and all control for you of what happens in it, and if you check this option, the IDE will create a main class based on the project name, which is not always expected, and netbeans will eventually define this class as the starting point of the project’s execution.

Also, if you need to change the main class later, you will have to tinker with the properties of the project, which may not be so simple for those starting.

But in short, this is not a problem, if you already know which class will be the starting point of your application in the creation of the project. If you uncheck this option, either way, netbeans will prompt you to choose a main class (if you have more than one with the main method) when running the project for the first time, and later you can rename this class as well.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.