code: private void updateLocation() {
  		try {
  			location = getLocationOnScreen();
  			location.y += getHeight();
  			dialog.setLocation(location);
  		} catch (IllegalComponentStateException e) {
  			return; // might happen on window creation
  		}
  	}
docs: Place the suggestion window under the JTextField.