首页 > 其他 > 详细

拆分窗口

时间:2017-04-23 17:22:22      阅读:185      评论:0      收藏:0      [点我收藏+]

 

 1 package Layout;
 2 import java.awt.*;
 3 import javax.swing.*;
 4 public class SplitWindow extends JFrame {
 5 private String str[] = {"软件开发","平面设计","动画制作","室内设计"};
 6 private JList lb = new JList(str);
 7 private JLabel bq = new JLabel(new ImageIcon("photo/psb.jpg"));
 8 private JSplitPane cf = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,lb,bq);//  左右拆分
 9 //private JSplitPane cf = new JSplitPane(JSplitPane.VERTICAL_SPLIT,lb,bq);//  上下拆分
10 public SplitWindow(){
11     
12     cf.setOneTouchExpandable(true);
13     this.add(cf);
14     this.setTitle("用户界面");
15     this.setSize(600, 500);
16     this.setLocation(100, 100);
17     this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
18     this.setVisible(true);
19 }
20     public static void main(String[] args) {
21     
22    SplitWindow l = new SplitWindow();
23     }
24 
25 }

 

拆分窗口

原文:http://www.cnblogs.com/the-wang/p/6752929.html

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