码迷,mamicode.com
首页 > 其他好文 > 详细

拆分窗口

时间:2017-04-23 18:07:51      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:extends   span   net   image   lis   ati   and   list   style   

 

 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 }

 

拆分窗口

标签:extends   span   net   image   lis   ati   and   list   style   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!