fork download
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import javax.swing.*; //notice javax
  4. public class Frame1 extends JFrame
  5. {
  6. JPanel pane = new JPanel();
  7. Frame1() // the frame constructor method
  8. {
  9. super("My Simple Frame"); setBounds(100,100,300,100);
  10. setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  11. Container con = this.getContentPane(); // inherit main frame
  12. con.add(pane); // add the panel to frame
  13. // customize panel here
  14. // pane.add(someWidget);
  15. setVisible(true); // display this frame
  16. }
  17. public static void main(String args[]) {new Frame1();}
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:4: error: class Frame1 is public, should be declared in a file named Frame1.java
public class Frame1 extends JFrame
       ^
1 error
stdout
Standard output is empty