JSplitPane的简单实现
2024-10-18 23:55:12
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(,);
this.setLocation(, );
this.setResizable(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true); } }
最新文章
- 【算法】(查找你附近的人) GeoHash核心原理解析及代码实现
- Spring MVC学习笔记——返回JSON对象
- 【集合框架】JDK1.8源码分析之LinkedList(七)
- canvas刮刮乐
- Jboss中不能正常的解析EL表达式
- 判断文件结束,feof……
- hihocoder 1237 Farthest Point
- c# 数据库缓存依赖
- 怎样在Win10下安装ubuntu双系统
- 主机和VMware中的Linux如实现共享文件夹
- js获取数组中最大值和最小值
- Windows Server 2016-系统安装软硬件要求
- ES6 模块
- 初级PM要做什么
- HTTP Status 405 - HTTP method POST is not supported by this URL
- intel FPGA使用
- ubuntu 无法挂载U盘
- Spring面试,IoC和AOP的理解
- XAMPP下apache部署网站,多个虚拟机(空间)配置
- Java的8种包装类:Wrapper Class