DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Java
  4. NetBeans Usability Tips

NetBeans Usability Tips

Dustin Marx user avatar by
Dustin Marx
·
May. 21, 12 · Interview
Like (2)
Save
Tweet
Share
13.94K Views

Join the DZone community and get the full member experience.

Join For Free

Java IDEs have come a long way since the days of JBuilder (though JBuilder seemed like a welcome advance at the time). Today's Java IDEs (such as NetBeans, Eclipse, IntelliJ IDEA, and JDeveloper) are very advanced tools that most Java developers embrace for writing significant Java code. As advanced as these IDEs are, they all still have their own quirks and each seems better and easier to use when one understands some key tips (or "tricks") to using that IDE more efficiently. In this post, I look at some tips I have found useful when using NetBeans.

Disabling Automatic Scanning

A problem that can be especially onerous when using NetBeans on a large code base with many related projects open is the occasionally too-frequent automatic scanning that NetBeans performs. This is supposed to only occur intermittently and its intention is good, but sometimes the intended behavior's value is worth less than the performance-degrading cost justifies. Fortunately, this option can be disabled when its cost is greater than its benefit. In the NetBeans for PHP blog post Enable auto-scanning of sources - Scan for External Changes, Petr Pisl covers how to do this in NetBeans 6.9.

This feature is also supported in NetBeans 7.1 as shown in the following screen snapshot (window shown is accessible by selecting Tools ⇒ Options ⇒ Miscellaneous ⇒ Files).

If the benefits of automatic scanning are desired (because, for example, multiple people are changing source code underneath each other frequently or because different editors are being used on the same versions of files), but less of it is wanted, another tip is to reduce the number of NetBeans projects and files that are open in NetBeans.

Controlling Level of NetBeans Hints

NetBeans's Java hints can aid the Java developer in improving and modernizing his or her Java code. The hints cover topics as diverse as performance, safety, conciseness, coding standards, likely bugs, latest JDK standards, and best practices. I do not cover these useful hints in more detail here because I've already covered them in multiple previous posts. I introduced NetBeans hints and how to enable them , configure them as warnings or errors, and introduced seven of the most important hints in my blog post Seven Indispensable NetBeans Java Hints. In the blog post Seven NetBeans Hints for Modernizing Java Code, I discussed seven more hints that are useful for bridging legacy Java code forward to use the best features of newer SDKs (J2SE 5, Java SE 6, and Java SE 7). My post Creating a NetBeans 7.1 Custom Hint demonstrates writing custom hints to further expand NetBeans hinting capability beyond the out-of-the-box hints.

Setting Source/Target JDK Appropriately

In the blog post Specifying Appropriate NetBeans JDK Source Release, I looked at several advantages of setting the JDK level for the NetBeans projects' source/target JDKs appropriately. This can make a major difference for developers using JDK 7 as it helps the hints covered in the previous tip to show areas where pre-JDK 7 code can be migrated to JDK 7 constructs. However, even developers using JDK 6 or JDK 5 can find value to having this set appropriately. The appropriate setting not only advertises features that are available, but it also prevents developers from mistakenly using newer versions when they are not yet available in the actual version of code the developer should be using. NetBeans will warn the developer that certain features are not available for that JDK setting, so it is important to have it set properly.

Leveraging NetBeans Keyboard Commands

Whether it's vi, emacs, Eclipse, NetBeans, or any other editor, the masters of the respective editors know and frequently use keyboard commands to get work done quickly. NetBeans offers so many keyboard-based commands that it's difficult to summarize them. However, some good starting points include Highlights of NetBeans IDE 7.0 Keyboard Shortcuts and Code Templates, NetBeans Tips and Tricks, Keyboard Shortcuts I Use All the Time, NetBeans IDE Keyboard Shortcuts, and NetBeans Shortcut Keys. NetBeans even supports Eclipse key bindings!

Hiding Clutter and Noise with Code Folding

My preference is to have as clean of code as possible. Sometimes, however, I am forced to deal with code that has a lot of unimportant junk or noise in it. In such cases, NetBeans's code folding support is welcome because I can hide that noise. It would obviously better if I could remove the unnecessary noise and code folding can be abused, but I am appreciative of the feature when it's my only option for reducing clutter and noise so that I can focus on what matters. I discussed NetBeans code folding in further detail in the post NetBeans Code Folding and the Case for Code Folding.

Other NetBeans Tips

There are numerous other useful NetBeans tips available online.

Roman Strobl's NetBeans Quick Tips

In the blog he maintained while working at Sun Microsystems, Roman Strobl wrote several "NetBeans Quick Tip" posts (although dated [mid-2000s], several of these are still applicable):

  1. NetBeans Quick Tip #1 - Setting Target JDK.
  2. NetBeans Quick Tip #2 - Generating Getters and Setters
  3. NetBeans Quick Tip #3 - Increasing Font Size
  4. NetBeans Quick Tip #4 - Extending the Build Process
  5. NetBeans Quick Tip #5 - EOL Sweeper
  6. NetBeans Quick Tip #6 - Abbreviations in Editor
  7. Quick Tip #7 - Macros in Editor
  8. NetBeans Quick Tip #8 - Using Custom Folds
  9. Quick Tip #9 - Better Responsivenes of Error Marks and Hints
  10. NetBeans Quick Tip #10 - Diffing Two Files
  11. NetBeans Quick Tip #11 - How to Save As...
  12. Netbeans Quick Tip #12 - Fast Navigation to Methods and Fields
  13. NetBeans Quick Tip #13 - Define a Shortcut for Ant Target
  14. NetBeans Quick Tip #14 - Accessing Files Outside Projects
  15. NetBeans Quick Tip #15 - Adding Multiple Components with Matisse
  16. NetBeans Quick Tip #16 - Using Dependent Projects
  17. NetBeans Quick Tip #17 - Faster Building of Projects with Dependencies
  18. NetBeans Quick Tip #18: What to Do when Things Go Wrong?
  19. NetBeans Quick Tip #19 - Positioning without Guidelines in Matisse
  20. NetBeans Quick Tip #20 - Killing Processes
  21. NetBeans Quick Tip #21 - Achieving Same Size
  22. NetBeans Quick Tip #22 - Using Matisse's Connection Manager
  23. NetBeans Quick Tip #23 - Changing Code in Blue Guarded Blocks
  24. NetBeans Quick Tip #24 - Correct Javadoc
  25. NetBeans Quick Tip #25 - Case Insensitive Code Completion
  26. NetBeans Quick Tip #26 - Short Package Names
  27. NetBeans Quick Tip #27 - Implementing Abstract Methods
  28. NetBeans Quick Tip #28 - Configuring Derby Database in NetBeans 5.0
  29. NetBeans Quick Tip #29 - Monitoring HTTP Communication
  30. NetBeans Quick Tip #30 - When GroupLayout Fails
  31. NetBeans Quick Tip #31 - Changing the Look and Feel
  32. NetBeans Quick Tip #32 - Faster and More Stable Ruby Support
  33. NetBeans Quick Tip #33 - Show Error Using Keyboard
  34. Keyboard Shortcuts I Use All the Time
Other Posts on NetBeans Tips
  • NetBeans Community Docs- Tips And Tricks
  • Dumb Coder NetBeans Tips
  • Gephi NetBeans Tips
  • Tips and Tricks of NetBeans
  • Netbeans Quick Tip: How to use tabs not spaces
  • Netbeans Tips and Tricks
  • Can I Diff Two Files Outside Version Control?

Your Favorite NetBeans Tip or Trick?

What is your favorite NetBeans tip or trick?

NetBeans Java (programming language) Code folding Java Development Kit POST (HTTP) Usability

Published at DZone with permission of Dustin Marx, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Build a Spring Boot GraalVM Image
  • Best Practices for Writing Clean and Maintainable Code
  • Specification by Example Is Not a Test Framework
  • 7 Ways for Better Collaboration Among Your Testers and Developers

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: