fork download
  1. import javax.swing.JFrame;
  2.  
  3. /**
  4. this program displays a frame
  5. */
  6. public class EmptyFrameViewer
  7. {
  8. public static void main(String[] args)
  9. {
  10. JFrame frame = new JFrame();
  11.  
  12. final int FRAME_WIDTH = 800;
  13. final int FRAME_HEIGHT = 800;
  14. frame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
  15. frame.setTitle("My First Frame");
  16. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  17.  
  18. frame.setVisible(true);
  19.  
  20. }
  21. }
  22.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:6: error: class EmptyFrameViewer is public, should be declared in a file named EmptyFrameViewer.java
	public class EmptyFrameViewer
	       ^
1 error
stdout
Standard output is empty