import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; public static void main(String args[]){ { JFrame frame = new JFrame("Login"); frame.setSize(350, 200); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public class NewUser extends JFrame { JButton create; JPanel newUserPanel; JTextField txuserer; JTextField passer; public NewUser(){ super("Registration"); create = new JButton("Create"); newUserPanel = new JPanel(); txuserer = new JTextField(15); passer = new JPasswordField(15); setSize(300,200); setLocation(500,280); newUserPanel.setLayout (null); txuserer.setBounds(70,30,150,20); passer.setBounds(70,65,150,20); create.setBounds(110,100,80,20); newUserPanel.add(create); newUserPanel.add(txuserer); newUserPanel.add(passer); getContentPane().add(newUserPanel); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); } } } } }); } }
I'm getting 6 errors. Can you help me fix them?
Error M<esssages:
----jGRASP exec: javac -g NewUser (1).java
NewUser (1).java:7: error: class, interface, or enum expected
public static void main(String args[]){
^
NewUser (1).java:11: error: class, interface, or enum expected
frame.setSize(350, 200);
^
NewUser (1).java:12: error: class, interface, or enum expected
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
^
NewUser (1).java:13: error: class, interface, or enum expected
}
^
NewUser (1).java:49: error: class, interface, or enum expected
}
^
NewUser (1).java:53: error: class, interface, or enum expected
}
^
6 errors
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.