Geertjan's Blog

  • October 13, 2012

JEditorPane Code Completion (Part 3)

Geertjan Wielenga
Product Manager

The final step is to put an object into the Lookup on key listening in each of the JEditorPanes, e.g., a "City" object for the CityEditorPane and a "Country" object for the CountryEditorPane. Then, within the CompletionProviders, only add items to the CompletionResultSet if the object of interest is in the Lookup.

The result is that you can then have different code completions in different JEditorPanes, as shown below:

I've also included the Tools | Options | Editor | Code Completion tab, so that the code completion can be customized.

The full source code for the example is here:


Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.