import java.awt.*;
import javax.swing.*;
public class GUI extends JFrame{
private JMenuBar mb=new JMenuBar();
private JMenu mm=new JMenu("文件");
private JMenuItem mi1=new JMenuItem("粘贴");
private JMenuItem mi2=new JMenuItem("复制");
private JLabel l=new JLabel();
public GUI(){
this.setLayout(null);
mm.add(mi1);
mm.add(mi2);
mb.add(mm);
this.setJMenuBar(mb);
l.setText("我的第一个图形用户界面");
l.setBounds(10,10,450,30);
this.getContentPane().add(l);
this.setBounds(330,250,500,150);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args){
new GUI();
}
}