import javax.swing.*; import java.awt.*; public class Foo extends JComponent { public Component foo() { return new <caret> } }