import javax.swing.*;
import java.awt.*;
public class MyJFrame extends JFrame {
Font f = new Font("隶书",Font.PLAIN,30);
Font f_user = new Font("隶书",Font.PLAIN,17);
JButton jb1,jb2,jb3,jb4,jb5,jb6;
public MyJFrame () {
JLayeredPane layeredPane=new JLayeredPane();
ImageIcon image=new ImageIcon("C:\\Users\\28194\\Pictures\\Saved Pictures\\背景.jpg");
JLabel jl=new JLabel(image);
JPanel jp=new JPanel();
jp.setBounds(0,0,image.getIconWidth(),image.getIconHeight());
jp.add(jl);
JLabel jLabel_title = new JLabel("教务管理系统");
jLabel_title.setBounds(25,0,200,90);
jLabel_title.setFont(f);
JLabel jLabel_user = new JLabel("用户:user");
jLabel_user.setBounds(700,0,100,90);
jLabel_user.setFont(f_user);
JPanel jPanel_label = new JPanel();
jPanel_label.setLayout(null);
jPanel_label.setBackground(Color.cyan);
jPanel_label.setBounds(0,0,image.getIconWidth(),90);
jPanel_label.add(jLabel_title);
jPanel_label.add(jLabel_user);
jb1=new JButton("系别管理");
jb1.setBounds(0,75,200,75);
jb1.setFont(f);
jb1.setForeground(Color.RED);
jb1.setContentAreaFilled(false);
jb1.setBorder(null);
jb2=new JButton("课程管理");
jb2.setContentAreaFilled(false);
jb2.setBorder(null);
jb2.setBounds(0,150,200,75);
jb2.setFont(f);
jb2.setForeground(Color.RED);
jb3=new JButton("成绩管理");
jb3.setContentAreaFilled(false);
jb3.setBorder(null);
jb3.setBounds(0,225,200,75);
jb3.setFont(f);
jb3.setForeground(Color.RED);
jb4=new JButton("学生资料查询");
jb4.setContentAreaFilled(false);
jb4.setBorder(null);
jb4.setBounds(0,300,200,75);
jb4.setFont(f);
jb4.setForeground(Color.RED);
jb5=new JButton("学生成绩查询");
jb5.setContentAreaFilled(false);
jb5.setBorder(null);
jb5.setBounds(0,375,200,75);
jb5.setFont(f);
jb5.setForeground(Color.RED);
jb6=new JButton("数据分析");
jb6.setContentAreaFilled(false);
jb6.setBorder(null);
jb6.setBounds(0,450,200,75);
jb6.setFont(f);
jb6.setForeground(Color.RED);
JPanel jPanel = new JPanel();
jPanel.setLayout(null);
jPanel.setBackground(Color.darkGray);
jPanel.setBounds(0,100,200,image.getIconHeight());
jPanel.add(jb1);
jPanel.add(jb2);
jPanel.add(jb3);
jPanel.add(jb4);
jPanel.add(jb5);
jPanel.add(jb6);
layeredPane.add(jp,JLayeredPane.DEFAULT_LAYER);
layeredPane.add(jPanel_label,JLayeredPane.MODAL_LAYER);
layeredPane.add(jPanel,JLayeredPane.MODAL_LAYER);
this.setLayeredPane(layeredPane);
this.setSize(image.getIconWidth(),image.getIconHeight());
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
public static void main(String[] args) {
MyJFrame myjframe = new MyJFrame();