Suggestion List

A pluggable drop-down suggestion list primarily built for Swing text fields.

SuggestionList allows you to easily create autocomplete drop-down lists for your Swing text input fields. The list automatically displays and filters suggestions while the user types into the field.

SuggestionList can be easily integrated into your existing JTextField to auto-complete a user's keystrokes. All you have to do is to just create a data source for the list and then bind the list to a JTextField. When more content than the specified minimum prefix length is typed, a drop-down box is automatically activated to display suggestions on the bottom left of the text field. The list uses a data source model, SuggestionListModel, to maintain its data. The makes the source data able to be updated during run time even after the list was bound to a input field.

The list component is highly customizable and the API (fully Javadoc'ed) comes with a number of usable methods to configure/ tune the component for your unique usage.

Attention: This product has been discontinued and superseded by Autocomplete. It will be soon completely removed from the Marketplace.


14 day 14-day money-back guarantee


Personal License

  • Perpetual license

  • unlimited applications

  • Can distribute binary products only

  • Non-commercial use


Developer License

  • Perpetual license

  • Unlimited projects

  • Can distribute code and binary products

  • Commercial use

  • 6 months support

Need custom services for this product? Get a quote


  • Able to customize the drop-down list (e.g. border, font, background, foreground, renderer, visibleRowCount etc)
  • Able to set the maximum row count to display in the list
  • Dynamic data model that allows you to add and remove elements after initialization
  • Duplicate elements are automatically eliminated from the data model before they get to the displayed list
  • Automatically sorts the list items based on their String value into alphabetical order (case-insensitively)
  • Automatically filters the list for options that correspond to the content typed by the user
  • Automatically copies the value of a list item selected via the keyboard into the JTextField and restores the input when the selection is cancelled (using the Esc key)
  • Able to set the minimum prefix length, i.e. the number of characters that must be entered before prompting the suggestion list
  • Able to set the fetch interval, i.e. the time in milliseconds when the timer kicks in to refresh the suggestions in the list
  • Able to enable/ disable auto-selection (highlighting) of list item on mouse rollover
  • Able to set the list navigation mode, i.e. the way the list is being navigated via keyboard actions (navigation is rotatable by default, navigating past the last item in the list goes back to the first item and vice versa)
  • Able to register various listeners to listen for selection change events, selection acceptance events, mouse events, keyboard events and popup menu events
  • Able to unplug the suggestion list from the current JTextField and attach it to another at runtime

Usage Example

import java.awt.BorderLayout;
import javax.swing.*;
import ngjmy.swing.suggestionlist.SuggestionList;

public class TestSuggestionList extends JFrame {

    public TestSuggestionList() {
        JTextField jtf = new JTextField();
        String[] entries = {"sugar", "sugarcane", "sugared", "sugars", "sugary", "suggest", "suggested", "suggestible", "suggesting", "suggestion", "suggestive", "suggests"};

        /* Creates a suggestion list with a given array of data source */
        SuggestionList suggestionList = new SuggestionList(entries);
        /* Sets the minimum prefix length for the list */
        /* Sets the maximum row count to display in the list */
        /* Binds the suggestion list to the text field */

        /* Adds the text field to the frame */
        add(jtf, BorderLayout.NORTH);

    public static void main(String[] args) {
        JFrame frame = new TestSuggestionList();
        frame.setSize(300, 200);


  1. Copy dist/SuggestionList.jar to the root directory of your application project.
  2. For Eclipse, in Package Explorer right click on SuggestionList.jar and select Build Path Add to Build Path. For Netbeans, in Project right-click on the project and select Properties. Go to Libraries, in Compile click Add JAR/ Folder and import SuggestionList.jar.