[Java] 拆分窗格JSplitPane →→→→→进入此内容的聊天室

来自 , 2020-12-30, 写在 Java, 查看 118 次.
URL http://www.code666.cn/view/e11943a6
  1. /**
  2.  * 功能:拆分窗格JSplitPane
  3.  */
  4. package com.jiemian;
  5. import java.awt.*;
  6.  
  7. import javax.swing.*;
  8.  
  9. public class Text8 extends JFrame{
  10.         JLabel jl1;
  11.         JSplitPane jsp;
  12.         JList jlist;
  13.  
  14.         public static void main(String[] args) {
  15.                
  16.                 Text8 text8 =new Text8();
  17.  
  18.         }
  19.        
  20.         public Text8(){
  21.                
  22.                 //创建组件
  23.                 jl1=new JLabel(new ImageIcon("images\\61050-102.jpg"));
  24.                
  25.                 String []word={"boy","key","girl","information","comfortable","gread"};
  26.                 jlist=new JList(word);
  27.                
  28.                 //拆分窗格
  29.                 jsp=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,jlist,jl1);
  30.                 //设置可变化
  31.                 jsp.setOneTouchExpandable(true);
  32.                
  33.                 this.add(jsp);
  34.                
  35.                 this.setSize(300, 300);
  36.                 this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  37.                 this.setVisible(true);
  38.                
  39.                
  40.         }
  41.  
  42. }
  43.  

回复 "拆分窗格JSplitPane"

这儿你可以回复上面这条便签

captcha