In java, I made a registration form using swing, the program gets compiled but when I run it no new window opens with the registration form that i created. And in command prompt also the cursor goes to the next command line as if the program has been executed and form window closed by the user. the code:
import java.util.*;
import javax.swing.*;
import java.awt.*;
class M {
JFrame f;
JPanel p;
JButton b1, b2;
TextField t;
JLabel l1, l2;
M() {
f = new JFrame("FIRST");
p = new JPanel();
f.getContentPane().add(p);
p.setVisible(true);
b1 = new JButton("Save");
b1.setBounds(10, 10, 10, 10);
p.add(b1);
b2 = new JButton("Exit");
b2.setBounds(25, 10, 10, 10);
p.add(b2);
}
public static void main(String arr[]) {
M m1 = new M();
}
}