嗨,我制作了一个演示 java 框架,但编译后我尝试运行它,但框架没有打开。我确实编译了它n没有错误有人可以帮我这是基本代码请查看它n帮助我thanx alot
import javax.swing.*;
import java.awt.*;
class DemoFrame extends JFrame
{
JPanel pmain,pmaster;
JLabel lname,lclas,lyear,lroll,lemail,lphn;
JTextField name,clas,year,roll,email,phn;
JButton submit,reset;
JPasswordField pass;
void demoFrame()
{
setTitle("Registration Form");
setSize(700,700);
lname=new JLabel("Name");
lclas=new JLabel("clas");
lyear=new JLabel("Year");
lemail=new JLabel("Email");
lphn=new JLabel("Phone");
lroll=new JLabel("Roll No.");
name=new JTextField(10);
clas=new JTextField(10);
year=new JTextField(10);
email=new JTextField(10);
phn=new JTextField(10);
roll=new JTextField(10);
submit=new JButton("Register Now");
reset=new JButton("Reset");
pmain=new JPanel(new GridLayout(5,2,3,3));
pmain.add(lname);
pmain.add(name);
pmain.add(lclas);
pmain.add(clas);
pmain.add(lroll);
pmain.add(roll);
pmain.add(lemail);
pmain.add(email);
pmain.add(lphn);
pmain.add(phn);
pmaster=new JPanel();
pmaster.add(pmain);
}
public static void main(String args[])
{
DemoFrame obj=new DemoFrame();
obj.demoFrame();
}
}