From: stormreaver
Written: 2021-11-29 19:59:40.479507
Subject: Netbeans Not Generating Import Statements

Netbeans stopped generating import statements several months ago, and opted for fully qualified names instead. It also stopped suggesting imports on the left side of the editor (the Add Import option disappeared). I finally figured out why.

Go to Tools/Options/Formatting, select Java as the language, select Imports as the category. If you're seeing fully qualified names (org.myclass.SomeClass) instead of just SomeClass, you probably have "Use Fully Qualified Names" selected.

I prefer to have each import done separately, so I chose "Use Single Class Imports". Now Netbeans once again generated import statements, and the "Add Import" option has returned.
You must register an account before you can reply.