import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import java.sql.*;
public class information_student extends JFrame{
public static void main(String[] args) {
JFrame frame=new JFrame("學生個人資訊");
JTree tree;
JPanel con;
Font font=new Font("黑體",Font.PLAIN,20);
frame.setVisible(true);
frame.setExtendedState(MAXIMIZED_BOTH);
frame.setResizable(false);
frame.setLayout(null);
DefaultMutableTreeNode root=new DefaultMutableTreeNode("學生資訊");
DefaultMutableTreeNode information_person=new DefaultMutableTreeNode("個人資訊");
DefaultMutableTreeNode information_course=new DefaultMutableTreeNode("選課資訊");
DefaultMutableTreeNode information_safe=new DefaultMutableTreeNode("賬號安全");
DefaultMutableTreeNode basic=new DefaultMutableTreeNode("基本資訊");
DefaultMutableTreeNode education=new DefaultMutableTreeNode("教學資訊");
DefaultMutableTreeNode select=new DefaultMutableTreeNode("選擇課程");
DefaultMutableTreeNode selected=new DefaultMutableTreeNode("已選課程");
DefaultMutableTreeNode alter=new DefaultMutableTreeNode("修改選課");
root.add(information_person);
root.add(information_course);
root.add(information_safe);
information_person.add(basic);
information_person.add(education);
information_course.add(select);
information_course.add(selected);
information_course.add(alter);
tree=new JTree(root);
tree.setFont(new Font("黑體",Font.PLAIN,18));
tree.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 10));
con=new JPanel();
JScrollPane scroll=new JScrollPane();
scroll.setViewportView(tree);
frame.add(scroll);
scroll.setBounds(0,150,250,980);
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/63212.html
標籤:Java相關
上一篇:JDBC的再次連接問題
