Is it possible to make the auto-complete in netbeans not depend on a key-combination?

12,769

Solution 1

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.

Solution 2

I think I found a solution. I set up autocomplete keyboard shortcuts for all letters and @, it seems to work. In some cases there is a small lag, but it doesn't prevent you from typing. It took about 5 minutes to add those shortcuts.

Share:
12,769
KdgDev
Author by

KdgDev

Updated on June 04, 2022

Comments

  • KdgDev
    KdgDev about 2 years

    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.

  • KdgDev
    KdgDev over 14 years
    Netbeans 6.7 has no "advanced options" under options.
  • FModa3
    FModa3 over 14 years
    Ah, your right. Looking it up, it seems it was removed in 6.5. I found a site here showing the code completion options (mrhaki.blogspot.com/2009/07/…) 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.
  • KdgDev
    KdgDev over 14 years
    Thanks for the link. I left a comment there, maybe that'll help.
  • Youarefunny
    Youarefunny about 13 years
    You are my hero. I have been looking for a way to do this forever. Now I can switch to netbeans. I never thought to add a shortcut for every key.
  • Youarefunny
    Youarefunny about 13 years
    Its funny because it also auto-completes words in comments :) Perfect for my terrible spelling.
  • Youarefunny
    Youarefunny about 13 years
    Just for anyone so that they don't spend five minutes adding all of the keybindings, you can edit ~/.netbeans/7.0/config/Editors/Keybindings/NetBeans/org-netb‌​eans-modules-editor-‌​settings-CustomKeybi‌​ndings.xml and copy and paste the lines. Just replace 7.0 with your netbeans version. Cheers
  • Cheung
    Cheung about 7 years
    netbeams 8.1 still no solution, the auto complete still delay about 1 second to me.