views:

500

answers:

1

Is it possible to make the code-completion on Netbeans automatic, like on Aptana or Visual Studio?

I've noticed that Netbeans can sometimes take a while to populate the list, so this might be asking a bit too much, but if possible, I'd like to somehow enable it.

The onlything I've found in the options is the ability to set a custom key-combo, but not to make this automatic.

I know that if you wait a bit, the auto-completion shows up anyway, but I want it to be without delay.

+1  A: 

It appears there is a setting in some NetBeans versions that sets the delay for the popup window.

  1. Choose Tools | Options
  2. Choose Advanced Options
  3. Open the Editing and then Editor Settings folders
  4. Select Java Editor and find the Delay of Completion Window Auto Popup property
  5. Enter a new Delay value in milliseconds (default is 250).

Article where I found it: http://www.informit.com/articles/article.aspx?p=519945&seqNum=5

The problem is that this article is a couple years old, so I opened NetBeans (6.1) on my computer and looked for the property but it didn't exist for the Java Editor (It did for other editors like the XML Editor). This leads me to believe my version is newer than the one in the article and the delay property no longer exists for the Java Editor (checking couldn't hurt though).

So instead, I decided to test the delay. I made a sample project, imported and instantiated a list, and then went to call a method. I stopped at the dot to let NetBeans offer suggestions and it was basically immediate (no noticeable delay). It is at this point, I am wondering if the delay you are experiencing is due purely to performance of the computer, especially since you indicate this occurs "sometimes". It is possible that you are looking at rather large classes, and NetBeans is taking extra time to look up the completions. You could try and test to see if this is true or not by testing code completion on a known large class. The other possibility is your computer is not as fast, or is doing work for another program at the same time. You can try and test this by restarting the computer, opening only NetBeans (to maximize resources to NetBeans), and try some code completions. If either exhibit noticeably faster delays, this is most likely the problem.

Hope this helps.

FModa3
Netbeans 6.7 has no "advanced options" under options.
WebDevHobo
Ah, your right. Looking it up, it seems it was removed in 6.5. I found a site here showing the code completion options (http://mrhaki.blogspot.com/2009/07/auto-popup-code-completion-in-netbeans.html) but I am guessing you have tried these and none talk about a delay value. I would try seeing if the delay is affected by your computer, and if not, perhaps someone will find an option we are not seeing.
FModa3
Thanks for the link. I left a comment there, maybe that'll help.
WebDevHobo