Java进阶代码

来源:互联网 发布:数据质量提升方案 编辑:程序博客网 时间:2024/06/11 01:58
package ui;


import java.awt.Frame;


import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JSplitPane;


public class day_20171113_jsplitpane extends JFrame{


/**
* @param args
*/
JSplitPane sp;
JLabel mainwin;
JList menu;
public static void main(String[] args) {
// TODO Auto-generated method stub
day_20171113_jsplitpane sp = new day_20171113_jsplitpane();


}
public day_20171113_jsplitpane(){
String[] menu1 = {"员工信息查询","员工异动管理","员工入职管理","员工试用期管理","员工离职管理"};
    menu = new JList(menu1);
    mainwin = new JLabel(new ImageIcon("image/panghu.jpg"));
    sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,menu,mainwin);
    sp.setOneTouchExpandable(true);
    this.add(sp);
    this.setTitle("人力资源管理系统");

this.setSize(500, 500);
this.setLocation(300, 300);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
}