首页 > Web开发 > 详细

JSplitPane的简单实现

时间:2016-11-04 16:56:06      阅读:193      评论:0      收藏:0      [点我收藏+]
import java.awt.Color;

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

public class fenye1 extends JFrame{

    JLabel jl;
    JList js;
    JSplitPane jp;
    
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        fenye1 f1=new fenye1();
    }

    
    
    public fenye1()
        {
        String [] a={"软件开发","软件测试","数据挖掘"};
        jl=new JLabel(new ImageIcon("image/23.jpg"));
        jl.setBackground(Color.pink);
        jl.setOpaque(true);
        js=new JList(a);
        jp=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,js,jl);
        jp.setOneTouchExpandable(true);
        this.add(jp);
        
        this.setTitle("担心ss");
        this.setSize(400,320);
        this.setLocation(100, 180);
        this.setResizable(true);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);技术分享
        this.setVisible(true);
        
        
        
        }
    
}

 

JSplitPane的简单实现

原文:http://www.cnblogs.com/luo-mao/p/6030460.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!