package FakeMenu;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.TextField;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import org.omg.PortableServer.ServantRetentionPolicyValue;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
public class FakeMenu extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
FakeMenu frame = new FakeMenu();
frame.setSize(500,500);
frame.setVisible(true);
}
/**
* Create the frame.
*/
public FakeMenu() {
setMenuBar(getMenuBar());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 308);
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JMenu mnFile = new JMenu("File");
menuBar.add(mnFile);
JMenu mnNewMenu_1 = new JMenu("New");
mnFile.add(mnNewMenu_1);
mnNewMenu_1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO 自动生成的方法存根
JOptionPane.showMessageDialog(null, "成功");
}
});
JMenu mnNewMenu_2 = new JMenu("Open");
mnFile.add(mnNewMenu_2);
JMenu mnSave_1 = new JMenu("Save");
mnFile.add(mnSave_1);
JMenu mnNewMenu = new JMenu("Edit");
menuBar.add(mnNewMenu);
JMenu mnCopy = new JMenu("Copy");
mnNewMenu.add(mnCopy);
JMenu mnCut = new JMenu("Cut");
mnNewMenu.add(mnCut);
JMenu mnNewMenu_3 = new JMenu("Paste");
mnNewMenu.add(mnNewMenu_3);
JMenu mnSave = new JMenu("Help");
menuBar.add(mnSave);
JMenu mnAbout = new JMenu("About");
mnSave.add(mnAbout);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
setVisible(true);
}
}