e840. 监听JTabbedPane中选中卡片的改变
2024-09-14 03:17:59
A tabbed pane fires a change event whenever the selected tab is changed either by the user or programmatically.
// Create the tabbed pane
JTabbedPane pane = new JTabbedPane(); // Add tabs...; see e830 向JTabbedPane中加入一个卡片 // Register a change listener
pane.addChangeListener(new ChangeListener() {
// This method is called whenever the selected tab changes
public void stateChanged(ChangeEvent evt) {
JTabbedPane pane = (JTabbedPane)evt.getSource(); // Get current tab
int sel = pane.getSelectedIndex();
}
});
Related Examples |
最新文章
- 基于内存,redis,mysql的高速游戏数据服务器设计架构
- 深入浅出设计模式——原型模式(Prototype Pattern)
- 报错 for input String ...
- Smart210学习记录-----Linux i2c驱动
- 腾讯云CentOS 6.6安装 Nginx
- 七牛CEO许式伟:移动游戏资源存贮的大趋势
- 为什么玩VR眼镜会头晕?
- K2 BPM+Microsoft Dynamics CRM,妥妥的~
- hdu 3308 LCIS 线段树
- python multiprocessing 多进程
- 关于cvAbs的那些事
- Jquery二级简单折叠菜单
- ADO.NET基础、数据增删改查
- ZOJ 3913 Bob wants to pour water
- hashcode的一些了解
- Zepto源码分析-event模块
- 如何开发一个chrome扩展
- Android Studio工程项目打包成SDK(jar或aar格式)
- 原生JS操作object HTMLTableSectionElement 对象,获取行数
- [math] sagemath