import javax.swing.JFrame;
public class XFrame extends JFrame {
}
I saved with name XFrame and compiled it, no bug. But when I want to create a new variable of type XFrame in the interaction pane:
new XFrame()
It showed "Static Error : Undefined class 'XFrame' "
If you're trying to create an object of type XFrame you need to declare a variable that refers to XFrame. For example you could try
EDIT
You need to create the object in the main method
Here's a link for more info about the main method
https://www.journaldev.com/12552/public-static-void-main-string-args-java-main-method