Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:36 Go to next message
Adam Salene is currently offline Adam SaleneFriend
Messages: 2
Registered: October 2021
Junior Member
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 199 times)
  • Attachment: plzwork4.png
    (Size: 85.03KB, Downloaded 132 times)
  • Attachment: plzwork5.png
    (Size: 13.53KB, Downloaded 137 times)
Re: Eclipse quick fix doesn't show awt classes [message #1847459 is a reply to message #1847449] Thu, 28 October 2021 06:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
I think this is controlled by Window -> Preferences -> Java -> Appearance -> Type Filters where most likely java.awt.* is check marked as filtered by default.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Eclipse quick fix doesn't show awt classes [message #1847462 is a reply to message #1847449] Thu, 28 October 2021 07:13 Go to previous messageGo to next message
Jay Arthanareeswaran is currently offline Jay ArthanareeswaranFriend
Messages: 128
Registered: July 2009
Senior Member
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 07:17 Go to previous messageGo to next message
Jay Arthanareeswaran is currently offline Jay ArthanareeswaranFriend
Messages: 128
Registered: July 2009
Senior Member
> 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 07:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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 15:03 Go to previous message
Adam Salene is currently offline Adam SaleneFriend
Messages: 2
Registered: October 2021
Junior Member
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: Thu Apr 25 05:13:11 GMT 2024

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

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

Back to the top