大家看一下我这个代码,编译过了但是为什么运行没结果

2020-03-25 07:41发布

import java.awt.*;import javax.swing.*;public class wz extends JFrame{JButton a1,a2,a3,a4,a5;public ...

import java.awt.*;

import javax.swing.*;

public class wz extends JFrame{

JButton a1,a2,a3,a4,a5;

public void wz(){

a1=new JButton("1");

a2=new JButton("2");

a3=new JButton("3");

a4=new JButton("4");

a5=new JButton("5");

this.add(a1,BorderLayout.NORTH);

this.add(a2,BorderLayout.SOUTH);

this.add(a3,BorderLayout.CENTER);

this.add(a4,BorderLayout.WEST);

this.add(a5,BorderLayout.EAST);

this.setTitle("6");

this.setSize(50,100);

this.setLocation(350,250);

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

this.setVisible(true);

}

public static void main(String[] args){

wz abc=new wz();

}

}