This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version = NetBeans IDE 6.9 (Build 201006101454) Operating System = Mac OS X version 10.6.4 running on x86_64 Java; VM; Vendor = 1.6.0_20 Runtime = Java HotSpot(TM) 64-Bit Server VM 16.3-b01-279 When creating a new Application project, there is an option to create a new class with a main () method. The default name for this class is Main. java. I don't like this name and prefer to use the project name as the main class, but this means I have to enter the project name twice- once for the project name, and once more for the main class. This double entry means that I'm at risk of getting the second entry wrong when I retype. I also need to take care to preserve the package name and dot. Although this is possible, it's an added cognitive load. A really useful enhancement would be some preference option which would use the project name as the main class. This means that if I enter MyNewProject as the project name, the main class is automatically created as MyNewProject.java and I don't have to type "MyNewProject" more than once. Thanks Bob
Might be a better default, especially if it would "autocamelize" your project name, which does not necessarily look anything like a Java class name. The question is what to do with the generated package name. Does the following make sense or is it redundant? Name: [test-frobnitz-download] (entered) Folder: [/tmp] (entered) Location: [/tmp/test-frobnitz-download] (computed) Package: [test.frobnitz.download] (suggested) Main Class: [test.frobnitz.download.TestFrobnitzDownload] (suggested)
(In reply to comment #1) > Might be a better default, especially if it would "autocamelize" your project > name, which does not necessarily look anything like a Java class name. The > question is what to do with the generated package name. Does the following make > sense or is it redundant? > > Name: [test-frobnitz-download] (entered) > Folder: [/tmp] (entered) > Location: [/tmp/test-frobnitz-download] (computed) > Package: [test.frobnitz.download] (suggested) > Main Class: [test.frobnitz.download.TestFrobnitzDownload] (suggested) I think the suggested package name (test.frobnitz.download) and suggested Main class name (test.frobnitz.download.TestFrobnitzDownload) both make good sense. My personal usage is to use a camel name for the project (eg MyJavaProject) and I would not want the to lose the embedded capitals in the main class name (ie. MyJavaProject.java is fine, but Myjavaproject.java is not). Obviously, there is a convention that package names do not contain caps. Additionally, for compatibility with previous versions, I would also allow the option for a user to stick with Main. I don't want this change to be forced upon an unwilling user.
>Additionally, for compatibility with previous versions, I would also allow the option for a user to stick with Main. This will require an additional UI option in the wizard and will complicate the UI. Anyway it's just a default which can be changed by the user in the 2nd step of the wizard.
Jesse's proposal seems good, I will do it in this way.
The only question is what to do with project names like: for-download-project where the camel case part is a keyword and it cannot be a package name. Should we ignore it (download.project) or escape it somehow like (forpkg.download.project)? I would prefer the escape, eg. by suffix pkg.
Fixed jet-main dbb301a14469
Integrated into 'main-golden', will be available in build *201009010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/dbb301a14469 User: Tomas Zezula <tzezula@netbeans.org> Log: #189591:Enhancement: default name of main class