Editor Hints on Development Update Center

Guest Author

Editor Hints aka Suggestions aka Quick Fixes can be found on update center. Download the latest daily build and install modules Editor Hints and Java Hints (both are necessary!). This is alpha version of the hints, we would like to provide the functionality so that we get early feedback. Comments should be sent to: dev-at-java-dot-netbeans-dot-org. Bugs should be filed in Issuezilla, component java, subcomponent hints.

Currently the following hints are available through update center (all of them are still under development):
  • Add Import
  • Add Throws Clause
  • Incompatible Types
  • Incorrect Arguments
  • Cast Parameter
  • Implement Abstract Methods
  • Unresolved Element
  • Initialize Variable

The up-to-date status of hints is kept here:


The light-bulb appears when appropriate error is detected in source code. You can activate the hint by mouse or by pressing Alt-Enter. It is necessary that your cursor is placed at the red-underlined part of code for the lightbulb to appear.

Before somebody will ask me through comments: yes, surround with try-catch hint will be developed as well, it will appear on the hints page soon ;-)


Initialize variable

Add throws clause

Add import

Cast parameter

Join the discussion

Comments ( 19 )
  • Giuliano Friday, June 3, 2005
    Hi, how can I install thats module?? I have install NetBeans 4.1, and in my Update Center havent any "Editor Hints" ou "Java Hints".
    Please help me, I want go to NetBeans but Eclipse have many function more than NetBeans.
  • Roman Strobl Friday, June 3, 2005
    As written in the post, this is alpha module, available for development version of NetBeans. So you need latest development build to install the module. Note that quality is not guaranteed with these builds. Some quality will be guaranteed with Q-builds, first will be available in few weeks.

    Are there any other things which you miss in NetBeans compared to Eclipse? Thanks.
  • Giuliano Friday, June 3, 2005
    I wait NetBeans have a Editor more powerfull, with QuickFix stable, highlighting improvements and plugins(modules) for webwork and Spring Frameworks. I work with frameworks and Eclipse have many plugins for easy development for this frameworks.
    (excuse me my poor english)
    thanks for information.
    ps. I read your blog every day!!
  • Roman Strobl Friday, June 3, 2005
    Hey, it's nice to know that people using Eclipse are reading my blog as well ;-) Re: highlighting improvements - do you mean error highlighting? If yes, there is something already available for 4.1 through update center (stable module called error stripe, but you probably know that from my blog). Or did you mean other highlighting improvements? Stay tuned for support of other frameworks. Plugin development should be simplified as well, so we may get more plugins for NetBeans in the future.
  • Roman Strobl Friday, June 3, 2005
    I've changed the post name to "Editor Hints on Development Update Center". So that readers know they need to use development builds to try hints.
  • Claudio Miranda Friday, June 3, 2005
    A feature I would like to see at NetBeans is, when a line like this is type:
    FileInputStream fi = new Fi<ctrl + space bar>
    The code completion will show only classes (not interfaces) who extends or implements FileInputStream. With this, unecessary classes, interfaces or constants are not displayed.
    I think this is very productive for day to day.
    Is there a way to configure "Fix Imports" to organizaze the level of imports, like: if there is more than 5 classes from same package, then it will import as wildcard.
  • Roman Strobl Friday, June 3, 2005
    Claudio, good suggestion with code completion, I'll check on Monday if this is planned with the new completion. There's not such an option to organize the level of imports (or I don't know about it ;-). It seems to be a good idea, can you file it to Issuezilla?
  • Navneet Karnani Friday, June 3, 2005
    Can't remove the interfaces from the code complete since its possible to use Interfaces and implement it in the new clause as an anonymous class.
  • vbrabant Friday, June 3, 2005
    Agree with you that you can't remove the interfaces. But you can firstly propose classes (more chance it will be a class) and why not also propose firstly non abstract class, if possible.
    Also another remark with code completion is that it would firstly propose what belongs in my project.
  • Claudio Miranda Friday, June 3, 2005
    I searched issuezilla and found http://www.netbeans.org/issues/show_bug.cgi?id=8226 (wow, year 2000), which reflects the needs I said earlier
  • Roman Strobl Friday, June 3, 2005
    Feel free to vote for it.
  • jrichard Friday, June 3, 2005
    Pretty good, but it needs 1) more quick fixes (as listed in the URL) and 2) "quick" rename in file. In eclipse, that's ctrl+1 rename in file.
  • Kumar Mettu Sunday, June 5, 2005

    I have used NB for a year before moving to Eclipse about 2 years back. I started using NB and Eclipse together for about a month.
    Few features I love in Eclipse missing in NB:

    1. Select a code block and use (pop up menu)Refactor --> Extract method.

    2. Select a code block and use (pop up menu)Source --> Surround with Try/Catch Block.

    3. A helpful hint to add Throws clause to method signate (I understand this is planed for 4.2 in hints).

    4. Generate Getters/Setters in Eclipse is way better than Encapsulate Fields of NetBeans (You know sometimes I want to generate only getters but not setters for a variable).

    There are few more but I am not sure whether this gets NB Teams attention to write up more :-)

    I surely love to completely switch to NB because its great compared to Eclipse for many features. But NB Surely is lacking some simple features like mentioned above compared to Eclipse.
  • Roman Strobl Sunday, June 5, 2005
    Kumar, here is status of these features:

    Ad 1. Being developed as experimental refactoring, you can try it from development update center (with latest development build).

    Ad 2. Planned, work will be started soon.

    Ad 3. Being developed, you can try it from development Update Center.

    Ad 4. Being developed, will be available through code completion (already works on the branch, will be merged in a few weeks - see demo here).

    What are the other features your missing? ;-)
  • Roman Strobl Sunday, June 5, 2005
    To JRichard: I've just tried "quick" rename in Eclipse. This is very nice. I want it in NetBeans.
  • Michel Graciano Tuesday, June 7, 2005
    Hi guys,
    for "Select a code block and use (pop up menu)Source --> Surround with Try/Catch Block." and others, like, if and so on, I develop the macros for this. Itś is so good. For named a property, for examplo, File, I create a macro to just captalise the class name. I think that IDE should make available, but I found a way to solve this. If you are intersting, send a email that I send this and others macros.
  • Roman Strobl Tuesday, June 7, 2005
    Michel, superb, why not to post it here? If you agree, send it to me and I will place it to my blog and mention you as the author (and celebrate you).
  • guest Tuesday, June 7, 2005
    A nice feature from IDEA that I believe Netbeans is still missing is some sort of hierarchical select. In IDEA, if you hit Ctrl-W, you will select the current word. Hit ctrl-w again and it will select one level higher up, for example the current method call if the previous ctrl-w selected a method name. Hit ctrl-w again and you select an entire statement. Again and you select a block, again and you select a method, again and you select the class, and so on and so on.
    Also, having Ctrl-x delete the current line when nothing is selected is very handy.
  • Roman Strobl Tuesday, June 7, 2005
    NetBeans has it! It's called smart selection and can be activated by Alt-Shift-S, Alt-Shift-A works backwards. Ctrl-E is for delete line.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.