package pack2;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JFrame;

public class num_2v extends JFrame implements ActionListener{

  JButton jb;

  public num_2v(){

   jb = new JButton("确定");

   jb.addActionListener(this);

   this.add(jb);

   this.setSize(300,300);

   this.setLocationRelativeTo(null);

   this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

   this.setVisible(true);

  }     

  public static void main(String[] args) {

   new num_2v();

  }

  @Override

  public void actionPerformed(ActionEvent e) {

   // TODO 自动生成的方法存根

   System.out.println("点击了按钮");

  }

}

posted on 2019-05-16 09:58  Anonym_白熊  阅读(794)  评论(0编辑  收藏  举报