Look at the icon of the Names.java file. The icon has a letter J which is surronded by a red circle. This means your Java class is located outside of the source root.
Refer to the links below to know more about the symbols used in intellij.
https://www.jetbrains.com/help/idea/symbols.html
To solve the above problem,you will have to configure the content root. Go to File > project structure > Modules and set the Lab1 folder as the src root.
After correctly setting it, the icon will be a blue circle surrounding the letter C.
More info about content root configuration is here:
https://www.jetbrains.com/help/idea/configuring-content-roots.html