1. import javax.swing.*;
  2. import java.awt.*;
  3.  
  4. public class JFrame {
  5. public static void main(String[] args) {
  6. JFrame myFrame = new JFrame();
  7. myFrame.setTitle("JFrame Window");
  8. myFrame.setSize(400, 200);
  9. myFrame.setLocation(200, 300);
  10. myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  11. myFrame.setVisible(true);
  12. }
  13.  
  14. }
  15.  
  16.  
  17. Exception in thread "main" java.lang.Error: Unresolved compilation problems:
  18. The method setTitle(String) is undefined for the type JFrame
  19. The method setSize(int, int) is undefined for the type JFrame
  20. The method setLocation(int, int) is undefined for the type JFrame
  21. EXIT_ON_CLOSE cannot be resolved or is not a field
  22. The method setVisible(boolean) is undefined for the type JFrame
  23.  
  24. at JFrame.main(JFrame.java:8)