How to Change Default Comment Block in Java with NetBeans 7.4

  • Java
  • Thread starter Fifty
  • Start date
  • Tags
    Java
In summary, to change the default opening comment block in NetBeans 7.4 for Java programs, go to Tools > Templates > Java > Java Class, and click the "Open In Editor" button at the bottom. The template is written with Freemarker or something similar, but it should provide enough information for you to make the necessary changes. Some tutorials may assume a higher level of Java knowledge, but this method should work for you.
  • #1
Fifty
35
0
I'm new to Java. My high school CS teacher requires an MLA-style comment block before the first package declaration in our programs, I was just wondering how I might change the default opening comment block.

I'm using NetBeans 7.4. I did some searching and I couldn't find much help. I mean I did, but most tutorials assumed java knowledge at a level far higher than mine at the moment.

Thanks for the help!
 
Technology news on Phys.org
  • #2
Go to Tools > Templates > Java > Java Class, and click the "Open In Editor" button at the bottom. It looks like the template is written with Freemarker or something similar, but you should be able to work from what's there.

I think that's what you're after.
 

1. How do I change the default comment block in Java with NetBeans 7.4?

To change the default comment block in Java with NetBeans 7.4, you can go to the Tools menu and select Options. Then, navigate to the Editor tab and select the Formatting tab. Under the Comments section, you can change the default comment block style by selecting a different template or by customizing your own.

2. Can I customize the default comment block in NetBeans 7.4?

Yes, you can customize the default comment block in NetBeans 7.4 by going to the Tools menu, selecting Options, and navigating to the Editor tab. Then, select the Formatting tab and under the Comments section, click on the Customize button. From there, you can add, remove, or edit the template for the default comment block.

3. Will changing the default comment block affect existing code in my project?

No, changing the default comment block in NetBeans 7.4 will not affect existing code in your project. It will only change the style of the comment block for new code that you write.

4. How can I revert back to the default comment block in NetBeans 7.4?

To revert back to the default comment block in NetBeans 7.4, you can go to the Tools menu and select Options. Then, navigate to the Editor tab and select the Formatting tab. Under the Comments section, click on the Reset button to reset the comment block to its default style.

5. Is it possible to add my own custom comment block in NetBeans 7.4?

Yes, it is possible to add your own custom comment block in NetBeans 7.4. You can do this by going to the Tools menu, selecting Options, and navigating to the Editor tab. Then, select the Formatting tab and under the Comments section, click on the Customize button. From there, you can create a new template for your custom comment block and save it for future use.

Similar threads

  • Programming and Computer Science
Replies
6
Views
12K
  • Programming and Computer Science
Replies
2
Views
3K
  • Programming and Computer Science
Replies
4
Views
1K
Replies
90
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • STEM Academic Advising
Replies
11
Views
1K
  • Feedback and Announcements
Replies
21
Views
2K
Replies
18
Views
5K
  • STEM Career Guidance
Replies
1
Views
5K
Back
Top