Split pane jsplitpane

From , 3 Years ago, written in Java, viewed 52 times.
URL https://pastebin.vip/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.  

Reply to "Split pane jsplitpane"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website