package chen.java123.view;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.JDesktopPane;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class MainView extends JFrame {
private JPanel contentPane;
private Component jpanel;
private JFrame frame;
JDesktopPane desktopPane;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MainView frame = new MainView();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public MainView() {
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 900, 600);
this.setLocationRelativeTo(null);
contentPane = new JPanel();
contentPane.setBackground(Color.BLACK);
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JMenuBar menuBar = new JMenuBar();
menuBar.setBounds(0, 0, 896, 36);
contentPane.add(menuBar);
JMenu mnNewMenu = new JMenu("基本数据维护");
mnNewMenu.setForeground(Color.BLUE);
menuBar.add(mnNewMenu);
JMenu mnNewMenu_2 = new JMenu("图书类别管理");
mnNewMenu.add(mnNewMenu_2);
JMenuItem mntmNewMenuItem_1 = new JMenuItem("图书类别的新增");
mntmNewMenuItem_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
BookTypeAdd booktypeadd =new BookTypeAdd();
desktopPane.add(booktypeadd);
booktypeadd.setVisible(true);
}
});
mnNewMenu_2.add(mntmNewMenuItem_1);
JMenuItem mntmNewMenuItem_2 = new JMenuItem("图书类别的维护");
mnNewMenu_2.add(mntmNewMenuItem_2);
JMenu mnNewMenu_3 = new JMenu("图书管理");
mnNewMenu.add(mnNewMenu_3);
JMenuItem mntmNewMenuItem_3 = new JMenuItem("图书新增");
mnNewMenu_3.add(mntmNewMenuItem_3);
JMenuItem mntmNewMenuItem_4 = new JMenuItem("图书维护");
mnNewMenu_3.add(mntmNewMenuItem_4);
JMenuItem mntmNewMenuItem = new JMenuItem("安全退出");
mnNewMenu.add(mntmNewMenuItem);
JMenu mnNewMenu_1 = new JMenu("关于我们");
mnNewMenu_1.setForeground(Color.BLUE);
menuBar.add(mnNewMenu_1);
JMenuItem mntmNewMenuItem_5 = new JMenuItem("关于我们");
mnNewMenu_1.add(mntmNewMenuItem_5);
JPanel panel = new JPanel();
panel.setBounds(169, 118, 475, 308);
contentPane.add(panel);
JLabel lblNewLabel = new JLabel("");
lblNewLabel.setIcon(new ImageIcon(MainView.class.getResource("/images/OIP-C.jpg")));
panel.add(lblNewLabel);
desktopPane = new JDesktopPane();
desktopPane.setBounds(67, 504, 765, -418);
contentPane.add(desktopPane);
}
}