Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipse quick fix doesn't show awt classes
Eclipse quick fix doesn't show awt classes [message #1847449] Wed, 27 October 2021 09:36 Go to next message
Eclipse UserFriend
I'm using jdk17 and eclipse 2021-09. When I hover over a class and the menu pops up it doesn't show and option for import on classes in java.awt but will show that option for other classes.
  • Attachment: plzwork1.png
    (Size: 23.29KB, Downloaded 276 times)
  • Attachment: plzwork4.png
    (Size: 85.03KB, Downloaded 239 times)
  • Attachment: plzwork5.png
    (Size: 13.53KB, Downloaded 238 times)
Re: Eclipse quick fix doesn't show awt classes [message #1847459 is a reply to message #1847449] Thu, 28 October 2021 02:19 Go to previous messageGo to next message
Eclipse UserFriend
I think this is controlled by Window -> Preferences -> Java -> Appearance -> Type Filters where most likely java.awt.* is check marked as filtered by default.
Re: Eclipse quick fix doesn't show awt classes [message #1847462 is a reply to message #1847449] Thu, 28 October 2021 03:13 Go to previous messageGo to next message
Eclipse UserFriend
I don't see this behavior in my set up. To understand this better, can you tell me what happens when you organize import or manually add the import statement import java.awt.image.BufferedImage; ?
Does the compiler recognize that the classes are available from the classpath?

Or by any chance, is your project a Java module? If so, do you have "requires java.desktop" in your module-info?
Re: Eclipse quick fix doesn't show awt classes [message #1847464 is a reply to message #1847462] Thu, 28 October 2021 03:17 Go to previous messageGo to next message
Eclipse UserFriend
> Or by any chance, is your project a Java module? If so, do you have "requires java.desktop" in your module-info?

I see Ed's suggestion is most likely it. I just tried out and in case of the module project missing the requires clause, we still suggest "import *** and requires ***".
Re: Eclipse quick fix doesn't show awt classes [message #1847466 is a reply to message #1847464] Thu, 28 October 2021 03:53 Go to previous messageGo to next message
Eclipse UserFriend
Hi

I recall a plan, perhaps a year ago, to remove java.awt from the defaults since for many years every use of List has been met with the awt/util import choice for which few users ever want awt; I have never used AWT.

This may explain why your experience is unfamiliar, or different to some tutorial.

You may need to specify java.awt explicitly since awt is now built-out rather than built-in.

(Depending on the context, content assist often fails to offer sensible candidates. Make sure that you request usage well away from templating or serious syntax errors.)

Regards

Ed Willink
Re: Eclipse quick fix doesn't show awt classes [message #1847483 is a reply to message #1847459] Thu, 28 October 2021 11:03 Go to previous message
Eclipse UserFriend
Ed Merks wrote on Thu, 28 October 2021 06:19
I think this is controlled by Window -> Preferences -> Java -> Appearance -> Type Filters where most likely java.awt.* is check marked as filtered by default.


This did it, thanks!
Previous Topic:When are you planning to apply for mac M1 eclipse IDE?
Next Topic:Does Eclipse 2021-09 support running java 1.7 unit tests?
Goto Forum:
  


Current Time: Wed Jul 02 22:59:19 EDT 2025

Powered by FUDForum. Page generated in 0.07841 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top