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);JSplitPane的简单实现this.setVisible(true);
        
        
        
        }
    
}

 

相关文章:

  • 2021-12-02
  • 2021-08-29
  • 2021-06-17
  • 2021-05-21
  • 2022-01-10
  • 2021-09-14
  • 2021-10-19
猜你喜欢
  • 2022-01-02
  • 2022-12-23
  • 2021-04-13
  • 2021-08-19
  • 2021-08-06
  • 2021-09-01
  • 2021-04-11
相关资源
相似解决方案