Completing a Java Expression

  1. In the Java Editor, type the first few characters of the expression, such as import javax.
  2. Press Ctrl-spacebar or Ctrl-\, or pause after typing a period, comma, or the keywords new or import (followed by a space).

    The code completion box is displayed, providing a scrolling list of possible classes, methods, variables, and so on that can complete your expression. For methods and fields, the code completion box displays only static or nonstatic options as appropriate, depending on the context of your code.

    Useful times to press Ctrl-spacebar include while entering the first parameter of a method and while typing a package name. Even if you disable automatic code completion completely, you can still access the code completion box at any time by pressing Ctrl-spacebar.

  3. Use the most convenient combination of the following options to select an item from the code completion box:

    If you press Enter for a method with parameters, replaceable text is given for the first parameter, which you can then fill in. If the method takes multiple parameters, you can reopen the list by typing a comma after you fill in each parameter.

    If the IDE recognizes the type of parameter required, its type is shown in the header of the code completion box. If not, a question mark (?) is displayed.

    If you enter a parameter that does not match any of the recognized parameter combinations for the method name, all the recognized methods and their parameter lists are displayed and an asterisk (*) appears in the header of the code completion box.

Note The elements displayed in the Java code completion box are defined by the parser database. You can update the parser database to include your own classes, as described in Updating the Parser Database.
See also
Completing an HTML Tag
Setting the Completion Box Delay
Disabling Automatic Completion
Setting Code Completion Shortcuts

Legal Notices