
this code is compiling but not running please help
import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Mybutton11 extends JFrame { JTextField text1 = new JTextField(20); JButton button1; JButton button2 ; JFrame frm;
public Mybutton11()
{
new JFrame("issuing form");
JLabel lbl = new JLabel("Please fill:");
frm.add(lbl);
frm.setSize(500,500);
frm.setVisible(true);
frm.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
JPanel p = new JPanel();
JPanel p1 = new JPanel();
p.setLayout(new GridLayout(3,1));
JLabel label1=new JLabel("Enter your name:", Label.RIGHT);
JLabel label2=new JLabel("Enter your age:", Label.RIGHT);
JTextField text2 = new JTextField(20);
JLabel label3=new JLabel("Enter your course:", Label.RIGHT);
JTextField text3 = new JTextField(20);
p.add(text1);
p.add(text2);
p.add(text3);
p.add(label1);
p.add(label2);
p.add(label3);
new JButton("SUBMIT");
p.add(button1);
new JButton("EXIT");
p.add(button2);
p1.add(p);
frm.add(p1,BorderLayout.NORTH);
button1.addActionListener(new ButtonListener());
button2.addActionListener(new ButtonListener());
}
public class ButtonListener implements ActionListener { public void actionPerformed(ActionEvent e) { if(e.getSource()==button1) { String name = text1.getText(); if(name.length()==0) { JOptionPane.showMessageDialog(null,"u didnt enter anything"); } JOptionPane.showMessageDialog(null, "Hello!! " + name); } //text1.requestFocus(); if(e.getSource()==button2) { frm.setDefaultCloseOperation(JFrame.EXITONCLOSE); } } } public static void main(String[] args) throws Exception { Mybutton11 m = new Mybutton11(); } }

Use
JFrame frm=new JFrame("issuing form");
outside the Mybutton11() constructor.
After this update, your frame will be visible.
For more detail go to this link
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.