0

When I begin typing "butt" for "button", the content assist recommends a Button - that is right and I want it like this. see example
But when I press enter, it inserts "java.awt.Button" see example

How do I tell the assist to insert only "Button"?

1 Answers1

0

Your Eclipse IDE may not be properly configured for JavaFX which could prevent autocomplete from finding JavaFX's classes. The solution is likely to update Eclipse IDE's access rules, otherwise you may be interested by this answer or this one. Read below for further details.

You already import JavaFX's Button whereas the autocomplete proposes AWT's Button (see the java.awt on the right of the proposal). To make sure AWT's Button is not mistaken for JavaFX's one its fully qualified name has to be use — hence java.awt.Button. The real issue is that your content assist should also propose the javafx.scene.control.Button class, and that should be solved by configuring access rules as described in the first answer I linked.

Emmanuel Chebbi
  • 456
  • 3
  • 5
  • 13