There is a line

JFrame topFrame = (JFrame) SwingUtilities.getWindowAncestor(this); 

Eclipse swears

GetWindowAncestor (Component) in the type

I do not understand what the matter is, Google didn’t really understand anything, what is written, tell me where to look?

    1 answer 1

    maybe your class is not inherited from Component, compare the imports in your class to SwingUtilities.getWindowAncestor or alternatively, maybe you accidentally imported the wrong SwingUtilities